test_management_commands: Fix a few comments.

This commit is contained in:
Greg Price 2018-01-26 12:19:20 -08:00 committed by Tim Abbott
parent 1d6b072626
commit 12e08a4fa7
1 changed files with 5 additions and 3 deletions

View File

@ -181,19 +181,21 @@ class TestGenerateRealmCreationLink(ZulipTestCase):
email = "user1@test.com"
generated_link = generate_realm_creation_url(by_admin=True)
# Check realm creation page is accessible
# Get realm creation page
result = self.client_get(generated_link)
self.assert_in_success_response([u"Create a new Zulip organization"], result)
# Create Realm with generated link
# Enter email
self.assertIsNone(get_realm('test'))
result = self.client_post(generated_link, {'email': email})
self.assertEqual(result.status_code, 302)
self.assertTrue(re.search('/accounts/do_confirm/\w+$', result["Location"]))
# Bypass sending mail for confirmation, go straight to creation form
result = self.client_get(result["Location"])
self.assert_in_response('action="/accounts/register/"', result)
# Generated link used for creating realm
# Original link is now dead
result = self.client_get(generated_link)
self.assert_in_success_response(["The organization creation link has expired or is not valid."], result)