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.

31 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(user=self.alice, 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(user=self.alice, kind="pushbullet",
  13. value="test-token")
  14. r = self.client.get("/admin/api/channel/")
  15. self.assertContains(r, "Pushbullet")
  16. def test_it_shows_channel_list_with_unverified_email(self):
  17. self.client.login(username="[email protected]", password="password")
  18. Channel.objects.create(user=self.alice, kind="email",
  19. value="[email protected]")
  20. r = self.client.get("/admin/api/channel/")
  21. self.assertContains(r, "Email <i>(unconfirmed)</i>")