mirror of https://github.com/zulip/zulip.git
tests: Move TestOpenRealms to test_signup.py.
This commit is contained in:
parent
e8b08d10f0
commit
729bcc8b16
|
@ -18,6 +18,7 @@ from zerver.lib.actions import do_change_password
|
|||
from zerver.views.invite import get_invitee_emails_set
|
||||
from zerver.models import (
|
||||
get_realm, get_prereg_user_by_email, get_user_profile_by_email,
|
||||
get_unique_open_realm, completely_open,
|
||||
PreregistrationUser, Realm, RealmAlias, Recipient,
|
||||
Referral, ScheduledJob, UserProfile, UserMessage,
|
||||
Stream, Subscription, ScheduledJob
|
||||
|
@ -1274,6 +1275,23 @@ class UserSignUpTest(ZulipTestCase):
|
|||
self.assertEqual(result.status_code, 302)
|
||||
self.assertEqual(get_session_dict_user(self.client.session), user_profile.id)
|
||||
|
||||
class TestOpenRealms(ZulipTestCase):
|
||||
def test_open_realm_logic(self):
|
||||
# type: () -> None
|
||||
realm = get_realm('simple')
|
||||
do_deactivate_realm(realm)
|
||||
|
||||
mit_realm = get_realm("zephyr")
|
||||
self.assertEqual(get_unique_open_realm(), None)
|
||||
mit_realm.restricted_to_domain = False
|
||||
mit_realm.save()
|
||||
self.assertTrue(completely_open(mit_realm))
|
||||
self.assertEqual(get_unique_open_realm(), None)
|
||||
with self.settings(SYSTEM_ONLY_REALMS={"zulip"}):
|
||||
self.assertEqual(get_unique_open_realm(), mit_realm)
|
||||
mit_realm.restricted_to_domain = True
|
||||
mit_realm.save()
|
||||
|
||||
class DeactivateUserTest(ZulipTestCase):
|
||||
|
||||
def test_deactivate_user(self):
|
||||
|
|
|
@ -24,7 +24,7 @@ from zerver.forms import WRONG_SUBDOMAIN_ERROR
|
|||
from zerver.models import UserProfile, Recipient, \
|
||||
Realm, RealmAlias, UserActivity, \
|
||||
get_user_profile_by_email, get_realm, get_client, get_stream, \
|
||||
Message, get_unique_open_realm, completely_open, get_context_for_message
|
||||
Message, get_context_for_message
|
||||
|
||||
from zerver.lib.avatar import avatar_url
|
||||
from zerver.lib.email_mirror import create_missed_message_address
|
||||
|
@ -572,24 +572,6 @@ class ExtractedRecipientsTest(TestCase):
|
|||
s = '"bob@zulip.com,alice@zulip.com"'
|
||||
self.assertEqual(sorted(extract_recipients(s)), ['alice@zulip.com', 'bob@zulip.com'])
|
||||
|
||||
|
||||
class TestOpenRealms(ZulipTestCase):
|
||||
def test_open_realm_logic(self):
|
||||
# type: () -> None
|
||||
realm = get_realm('simple')
|
||||
do_deactivate_realm(realm)
|
||||
|
||||
mit_realm = get_realm("zephyr")
|
||||
self.assertEqual(get_unique_open_realm(), None)
|
||||
mit_realm.restricted_to_domain = False
|
||||
mit_realm.save()
|
||||
self.assertTrue(completely_open(mit_realm))
|
||||
self.assertEqual(get_unique_open_realm(), None)
|
||||
with self.settings(SYSTEM_ONLY_REALMS={"zulip"}):
|
||||
self.assertEqual(get_unique_open_realm(), mit_realm)
|
||||
mit_realm.restricted_to_domain = True
|
||||
mit_realm.save()
|
||||
|
||||
class TestLoginPage(ZulipTestCase):
|
||||
def test_login_page_wrong_subdomain_error(self):
|
||||
# type: () -> None
|
||||
|
|
Loading…
Reference in New Issue