From 94e3c02649fb5b02aba9d3b9308a42623fda4465 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 17 Dec 2013 13:59:57 -0500 Subject: [PATCH] Add test_bulk_invite_users(). (imported from commit bc8ab756dae0fd82e73b5b2a9655974c5fc839b0) --- zerver/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zerver/tests.py b/zerver/tests.py index 8b23348cc3..de2327dd0c 100644 --- a/zerver/tests.py +++ b/zerver/tests.py @@ -2342,6 +2342,17 @@ class InviteUserTest(AuthedTestCase): email_recipients = [email.recipients()[0] for email in outbox] self.assertItemsEqual(email_recipients, correct_recipients) + def test_bulk_invite_users(self): + # The bulk_invite_users code path is for the first user in a realm. + self.login('hamlet@zulip.com') + invitees = ['alice@zulip.com', 'bob@zulip.com'] + params = { + 'invitee_emails': ujson.dumps(invitees) + } + result = self.client.post('/json/bulk_invite_users', params) + self.assert_json_success(result) + self.check_sent_emails(invitees) + def test_successful_invite_user(self): """ A call to /json/invite_users with valid parameters causes an invitation