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.

24 lines
823 B

  1. from hc.test import BaseTestCase
  2. class NotificationsTestCase(BaseTestCase):
  3. def test_it_saves_reports_allowed_true(self):
  4. self.client.login(username="[email protected]", password="password")
  5. form = {"reports_allowed": "on"}
  6. r = self.client.post("/accounts/profile/notifications/", form)
  7. assert r.status_code == 200
  8. self.alice.profile.refresh_from_db()
  9. self.assertTrue(self.alice.profile.reports_allowed)
  10. def test_it_saves_reports_allowed_false(self):
  11. self.client.login(username="[email protected]", password="password")
  12. form = {}
  13. r = self.client.post("/accounts/profile/notifications/", form)
  14. assert r.status_code == 200
  15. self.alice.profile.refresh_from_db()
  16. self.assertFalse(self.alice.profile.reports_allowed)