forked from GithubBackups/healthchecks
Handle pushbullet in admin, channel changelist
This commit is contained in:
parent
bff4eb4f80
commit
e1ba095446
@ -155,6 +155,8 @@ class ChannelsAdmin(admin.ModelAdmin):
|
||||
return "PagerDuty"
|
||||
elif obj.kind == "victorops":
|
||||
return "VictorOps"
|
||||
elif obj.kind == "pushbullet":
|
||||
return "Pushbullet"
|
||||
elif obj.kind == "po":
|
||||
return "Pushover"
|
||||
elif obj.kind == "webhook":
|
||||
|
22
hc/api/tests/test_admin.py
Normal file
22
hc/api/tests/test_admin.py
Normal file
@ -0,0 +1,22 @@
|
||||
from hc.api.models import Channel, Check
|
||||
from hc.test import BaseTestCase
|
||||
|
||||
|
||||
class ApiAdminTestCase(BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(ApiAdminTestCase, self).setUp()
|
||||
self.check = Check.objects.create(user=self.alice, tags="foo bar")
|
||||
|
||||
self.alice.is_staff = True
|
||||
self.alice.is_superuser = True
|
||||
self.alice.save()
|
||||
|
||||
def test_it_shows_channel_list_with_pushbullet(self):
|
||||
self.client.login(username="alice@example.org", password="password")
|
||||
|
||||
ch = Channel(user=self.alice, kind="pushbullet", value="test-token")
|
||||
ch.save()
|
||||
|
||||
r = self.client.get("/admin/api/channel/")
|
||||
self.assertContains(r, "Pushbullet")
|
Loading…
x
Reference in New Issue
Block a user