From d6cfa56bc158cf0304abb14eef2c40666b1e4694 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 27 Nov 2017 17:49:50 -0800 Subject: [PATCH] test_signup: Test that cloning a system bot's email is not allowed. Just now this is largely redundant with `test_signup_already_active`; but very soon when we allow reusing an email across realms, the logic will diverge. --- zerver/tests/test_signup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py index 8b02e618ed..d346b8c861 100644 --- a/zerver/tests/test_signup.py +++ b/zerver/tests/test_signup.py @@ -1470,6 +1470,16 @@ class UserSignUpTest(ZulipTestCase): result = self.client_get(result.url) self.assert_in_response("You've already registered", result) + def test_signup_system_bot(self) -> None: + email = "notification-bot@zulip.com" + result = self.client_post('/accounts/home/', {'email': email}, subdomain="lear") + self.assertEqual(result.status_code, 302) + self.assertIn('login', result['Location']) + result = self.client_get(result.url) + + # This is not really the right error message, but at least it's an error. + self.assert_in_response("You've already registered", result) + def test_signup_invalid_name(self) -> None: """ Check if an invalid name during signup is handled properly.