You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

  1. from hc.api.models import Channel, Check
  2. from hc.test import BaseTestCase
  3. class ApiAdminTestCase(BaseTestCase):
  4. def setUp(self):
  5. super(ApiAdminTestCase, self).setUp()
  6. self.check = Check.objects.create(project=self.project, tags="foo bar")
  7. self.alice.is_staff = True
  8. self.alice.is_superuser = True
  9. self.alice.save()
  10. def test_it_shows_channel_list_with_pushbullet(self):
  11. self.client.login(username="[email protected]", password="password")
  12. Channel.objects.create(
  13. project=self.project, kind="pushbullet", value="test-token"
  14. )
  15. r = self.client.get("/admin/api/channel/")
  16. self.assertContains(r, "Pushbullet")
  17. def test_it_shows_channel_list_with_unverified_email(self):
  18. self.client.login(username="[email protected]", password="password")
  19. Channel.objects.create(
  20. project=self.project, kind="email", value="[email protected]"
  21. )
  22. r = self.client.get("/admin/api/channel/")
  23. self.assertContains(r, "Email <i>(unconfirmed)</i>")