test-backend: Raise zerver/views/unsubscribe.py test coverage to 100%.

This commit is contained in:
Elliott Jin 2017-02-26 12:48:38 -08:00 committed by Tim Abbott
parent 9e0d3262bb
commit cebc67f9b0
2 changed files with 8 additions and 1 deletions

View File

@ -99,7 +99,6 @@ not_yet_fully_covered = {
'zerver/views/integrations.py',
'zerver/views/messages.py',
'zerver/views/report.py',
'zerver/views/unsubscribe.py',
'zerver/views/zephyr.py',
'zerver/views/invite.py',
'zerver/views/home.py',

View File

@ -690,9 +690,17 @@ class InviteeEmailsParserTests(TestCase):
class EmailUnsubscribeTests(ZulipTestCase):
def test_error_unsubscribe(self):
# type: () -> None
# An invalid insubscribe token "test123" produces an error.
result = self.client_get('/accounts/unsubscribe/missed_messages/test123')
self.assert_in_response('Unknown email unsubscribe request', result)
# An unknown message type "fake" produces an error.
user_profile = get_user_profile_by_email("hamlet@zulip.com")
unsubscribe_link = one_click_unsubscribe_link(user_profile, "fake")
result = self.client_get(urllib.parse.urlparse(unsubscribe_link).path)
self.assert_in_response('Unknown email unsubscribe request', result)
def test_missedmessage_unsubscribe(self):
# type: () -> None
"""