mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
test_classes: Refactor submit_reg_form_for_user.
This is a pure refactor in preparation for adding another argument.
This commit is contained in:
@@ -306,7 +306,8 @@ class ZulipTestCase(TestCase):
|
|||||||
|
|
||||||
def submit_reg_form_for_user(self, email, password, realm_name="Zulip Test",
|
def submit_reg_form_for_user(self, email, password, realm_name="Zulip Test",
|
||||||
realm_subdomain="zuliptest",
|
realm_subdomain="zuliptest",
|
||||||
from_confirmation='', full_name=None, timezone=u'', **kwargs):
|
from_confirmation='', full_name=None, timezone=u'',
|
||||||
|
**kwargs):
|
||||||
# type: (Text, Text, Optional[Text], Optional[Text], Optional[Text], Optional[Text], Optional[Text], **Any) -> HttpResponse
|
# type: (Text, Text, Optional[Text], Optional[Text], Optional[Text], Optional[Text], Optional[Text], **Any) -> HttpResponse
|
||||||
"""
|
"""
|
||||||
Stage two of the two-step registration process.
|
Stage two of the two-step registration process.
|
||||||
@@ -318,16 +319,17 @@ class ZulipTestCase(TestCase):
|
|||||||
"""
|
"""
|
||||||
if full_name is None:
|
if full_name is None:
|
||||||
full_name = email.replace("@", "_")
|
full_name = email.replace("@", "_")
|
||||||
return self.client_post('/accounts/register/',
|
payload = {
|
||||||
{'full_name': full_name,
|
'full_name': full_name,
|
||||||
'password': password,
|
'password': password,
|
||||||
'realm_name': realm_name,
|
'realm_name': realm_name,
|
||||||
'realm_subdomain': realm_subdomain,
|
'realm_subdomain': realm_subdomain,
|
||||||
'key': find_key_by_email(email),
|
'key': find_key_by_email(email),
|
||||||
'timezone': timezone,
|
'timezone': timezone,
|
||||||
'terms': True,
|
'terms': True,
|
||||||
'from_confirmation': from_confirmation},
|
'from_confirmation': from_confirmation,
|
||||||
**kwargs)
|
}
|
||||||
|
return self.client_post('/accounts/register/', payload, **kwargs)
|
||||||
|
|
||||||
def get_confirmation_url_from_outbox(self, email_address, path_pattern="(\S+)>"):
|
def get_confirmation_url_from_outbox(self, email_address, path_pattern="(\S+)>"):
|
||||||
# type: (Text, Text) -> Text
|
# type: (Text, Text) -> Text
|
||||||
|
|||||||
Reference in New Issue
Block a user