org settings: Handle NEW_USER_BOT not being set.

If NEW_USER_BOT is not configured in organization, then disable setting
for selecting stream for new user notification.
This commit is contained in:
YJDave
2017-12-20 22:28:49 +05:30
committed by showell
parent 2ca0fb4128
commit 15dd94035c
8 changed files with 23 additions and 4 deletions

View File

@@ -216,6 +216,10 @@ class RealmTest(ZulipTestCase):
new_signup_notifications_stream_id = 4
req = dict(signup_notifications_stream_id = ujson.dumps(new_signup_notifications_stream_id))
with self.settings(NEW_USER_BOT=None):
result = self.client_patch("/json/realm", req)
self.assert_json_error(result, 'NEW_USER_BOT must configured first.')
result = self.client_patch('/json/realm', req)
self.assert_json_success(result)
realm = get_realm('zulip')