mirror of
https://github.com/healthchecks/healthchecks.git
synced 2024-11-21 15:17:57 +00:00
ccc8faa953
The test is checking if a Pushbullet channel shows up in the channels list. It was looking for the string "Pushbullet". The problem is this string shows up unconditionally on the right side filters panel. The fix is to look for "ic-pushbullet" (the pushbullet icon), which should only appear inside the list view.
25 lines
743 B
Python
25 lines
743 B
Python
from __future__ import annotations
|
|
|
|
from hc.api.models import Channel, Check
|
|
from hc.test import BaseTestCase
|
|
|
|
|
|
class ApiAdminTestCase(BaseTestCase):
|
|
def setUp(self) -> None:
|
|
super().setUp()
|
|
self.check = Check.objects.create(project=self.project, 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) -> None:
|
|
self.client.login(username="alice@example.org", password="password")
|
|
|
|
Channel.objects.create(
|
|
project=self.project, kind="pushbullet", value="test-token"
|
|
)
|
|
|
|
r = self.client.get("/admin/api/channel/")
|
|
self.assertContains(r, "ic-pushbullet")
|