From a32cee4b105788a5407e8666269c761fadaa9fe4 Mon Sep 17 00:00:00 2001 From: Umair Khan Date: Mon, 10 Oct 2016 15:51:59 +0500 Subject: [PATCH] Add test to show error msg for invalid subdomain. --- zerver/tests/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zerver/tests/tests.py b/zerver/tests/tests.py index 7ed89888af..98d41ce7c1 100644 --- a/zerver/tests/tests.py +++ b/zerver/tests/tests.py @@ -14,6 +14,7 @@ from zerver.lib.test_helpers import ( most_recent_message, make_client ) from zerver.lib.test_runner import slow +from zerver.forms import WRONG_SUBDOMAIN_ERROR from zerver.models import UserProfile, Recipient, \ Realm, RealmAlias, UserActivity, \ @@ -2136,3 +2137,9 @@ class TestOpenRealms(ZulipTestCase): self.assertEquals(get_unique_open_realm(), mit_realm) mit_realm.restricted_to_domain = True mit_realm.save() + +class TestLoginPage(ZulipTestCase): + def test_login_page_with_subdomains(self): + # type: () -> None + result = self.client_get("/login/?subdomain=1") + self.assertIn(WRONG_SUBDOMAIN_ERROR, result.content.decode('utf8'))