actions: Fix incorrect calls to do_invite_users.

An integer or no argument is supposed to be passed.
These weren't caught by mypy because booleans are integers in python,
see https://github.com/python/mypy/issues/1757
This commit is contained in:
Mateusz Mandera 2021-08-01 13:46:25 +02:00 committed by Tim Abbott
parent 18ca7bf7f9
commit 1c4ad6769d
2 changed files with 6 additions and 6 deletions

View File

@ -671,7 +671,7 @@ class NormalActionsTest(BaseAction):
streams = [] streams = []
for stream_name in ["Denmark", "Verona"]: for stream_name in ["Denmark", "Verona"]:
streams.append(get_stream(stream_name, self.user_profile.realm)) streams.append(get_stream(stream_name, self.user_profile.realm))
do_invite_users(self.user_profile, ["foo@zulip.com"], streams, False) do_invite_users(self.user_profile, ["foo@zulip.com"], streams)
prereg_users = PreregistrationUser.objects.filter( prereg_users = PreregistrationUser.objects.filter(
referred_by__realm=self.user_profile.realm referred_by__realm=self.user_profile.realm
) )
@ -705,7 +705,7 @@ class NormalActionsTest(BaseAction):
for stream_name in ["Denmark", "Scotland"]: for stream_name in ["Denmark", "Scotland"]:
streams.append(get_stream(stream_name, self.user_profile.realm)) streams.append(get_stream(stream_name, self.user_profile.realm))
do_invite_users(self.user_profile, ["foo@zulip.com"], streams, False) do_invite_users(self.user_profile, ["foo@zulip.com"], streams)
prereg_user = PreregistrationUser.objects.get(email="foo@zulip.com") prereg_user = PreregistrationUser.objects.get(email="foo@zulip.com")
events = self.verify_action( events = self.verify_action(

View File

@ -2039,15 +2039,15 @@ so we didn't send them an invitation. We did send invitations to everyone else!"
for stream_name in ["Denmark", "Scotland"]: for stream_name in ["Denmark", "Scotland"]:
streams.append(get_stream(stream_name, self.user_profile.realm)) streams.append(get_stream(stream_name, self.user_profile.realm))
do_invite_users(self.user_profile, ["foo@zulip.com"], streams, False) do_invite_users(self.user_profile, ["foo@zulip.com"], streams)
prereg_user = PreregistrationUser.objects.get(email="foo@zulip.com") prereg_user = PreregistrationUser.objects.get(email="foo@zulip.com")
do_invite_users(self.user_profile, ["foo@zulip.com"], streams, False) do_invite_users(self.user_profile, ["foo@zulip.com"], streams)
do_invite_users(self.user_profile, ["foo@zulip.com"], streams, False) do_invite_users(self.user_profile, ["foo@zulip.com"], streams)
# Also send an invite from a different realm. # Also send an invite from a different realm.
lear = get_realm("lear") lear = get_realm("lear")
lear_user = self.lear_user("cordelia") lear_user = self.lear_user("cordelia")
do_invite_users(lear_user, ["foo@zulip.com"], [], False) do_invite_users(lear_user, ["foo@zulip.com"], [])
invites = PreregistrationUser.objects.filter(email__iexact="foo@zulip.com") invites = PreregistrationUser.objects.filter(email__iexact="foo@zulip.com")
self.assert_length(invites, 4) self.assert_length(invites, 4)