tests: Extract realm name and string_id values in variables.

This is a prep commit so that we can use these variables to
verify the urls in next commit.
This commit is contained in:
Sahil Batra
2023-04-26 20:00:25 +05:30
committed by Tim Abbott
parent 850e0046eb
commit f8f4fa4c5e
2 changed files with 6 additions and 4 deletions

View File

@@ -323,15 +323,17 @@ class TestGenerateRealmCreationLink(ZulipTestCase):
@override_settings(OPEN_REALM_CREATION=False)
def test_generate_link_confirm_email(self) -> None:
email = "user1@test.com"
realm_name = "Zulip test"
string_id = "zuliptest"
generated_link = generate_realm_creation_url(by_admin=False)
result = self.client_post(
generated_link,
{
"email": email,
"realm_name": "Zulip test",
"realm_name": realm_name,
"realm_type": Realm.ORG_TYPES["business"]["id"],
"realm_subdomain": "zuliptest",
"realm_subdomain": string_id,
},
)
self.assertEqual(result.status_code, 302)

View File

@@ -1543,7 +1543,7 @@ class RealmCreationTest(ZulipTestCase):
password = "test"
string_id = "zuliptest"
email = "user1@test.com"
realm_name = "Test"
realm_name = "Zulip test"
# Make sure the realm does not exist
with self.assertRaises(Realm.DoesNotExist):
@@ -1551,7 +1551,7 @@ class RealmCreationTest(ZulipTestCase):
# Create new realm with the email
result = self.submit_realm_creation_form(
email, realm_subdomain=string_id, realm_name="Zulip test"
email, realm_subdomain=string_id, realm_name=realm_name
)
self.assertEqual(result.status_code, 302)
self.assertTrue(