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.2 KiB

6 years ago
6 years ago
6 years ago
  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(user=self.alice, tags="foo bar",
  7. project=self.project)
  8. self.alice.is_staff = True
  9. self.alice.is_superuser = True
  10. self.alice.save()
  11. def test_it_shows_channel_list_with_pushbullet(self):
  12. self.client.login(username="[email protected]", password="password")
  13. Channel.objects.create(user=self.alice, kind="pushbullet",
  14. value="test-token", project=self.project)
  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(user=self.alice, kind="email",
  20. value="[email protected]", project=self.project)
  21. r = self.client.get("/admin/api/channel/")
  22. self.assertContains(r, "Email <i>(unconfirmed)</i>")