|
|
@ -17,7 +17,7 @@ class UnsubscribeReportsTestCase(BaseTestCase): |
|
|
|
url = "/accounts/unsubscribe_reports/%s/" % sig |
|
|
|
|
|
|
|
r = self.client.get(url) |
|
|
|
self.assertContains(r, "You have been unsubscribed") |
|
|
|
self.assertContains(r, "Unsubscribed") |
|
|
|
|
|
|
|
self.profile.refresh_from_db() |
|
|
|
self.assertFalse(self.profile.reports_allowed) |
|
|
@ -30,3 +30,17 @@ class UnsubscribeReportsTestCase(BaseTestCase): |
|
|
|
url = "/accounts/unsubscribe_reports/invalid/" |
|
|
|
r = self.client.get(url) |
|
|
|
self.assertContains(r, "Incorrect Link") |
|
|
|
|
|
|
|
def test_post_works(self): |
|
|
|
sig = signing.TimestampSigner(salt="reports").sign("alice") |
|
|
|
url = "/accounts/unsubscribe_reports/%s/" % sig |
|
|
|
|
|
|
|
r = self.client.post(url) |
|
|
|
self.assertContains(r, "Unsubscribed") |
|
|
|
|
|
|
|
def test_it_serves_confirmation_form(self): |
|
|
|
sig = signing.TimestampSigner(salt="reports").sign("alice") |
|
|
|
url = "/accounts/unsubscribe_reports/%s/?ask=1" % sig |
|
|
|
|
|
|
|
r = self.client.get(url) |
|
|
|
self.assertContains(r, "Please press the button below") |