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

from hc.test import BaseTestCase
class NotificationsTestCase(BaseTestCase):
def test_it_saves_reports_allowed_true(self):
self.client.login(username="[email protected]", password="password")
form = {"reports_allowed": "on"}
r = self.client.post("/accounts/profile/notifications/", form)
assert r.status_code == 200
self.alice.profile.refresh_from_db()
self.assertTrue(self.alice.profile.reports_allowed)
def test_it_saves_reports_allowed_false(self):
self.client.login(username="[email protected]", password="password")
form = {}
r = self.client.post("/accounts/profile/notifications/", form)
assert r.status_code == 200
self.alice.profile.refresh_from_db()
self.assertFalse(self.alice.profile.reports_allowed)