Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tests: Pass all arguments in do_change_stream_permission.

Sahil Batra75768decf1cf
diff --git a/zerver/tests/test_bots.py b/zerver/tests/test_bots.py
index d80710dc533..dce1befd529 100644
--- a/zerver/tests/test_bots.py
+++ b/zerver/tests/test_bots.py
@@ -419,7 +419,13 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
user_profile = self.example_user("hamlet")
stream = get_stream("Denmark", user_profile.realm)
self.subscribe(user_profile, stream.name)
- do_change_stream_permission(stream, invite_only=True, acting_user=user_profile)
+ do_change_stream_permission(
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=user_profile,
+ )
self.assert_num_bots_equal(0)
events: List[Mapping[str, Any]] = []
@@ -464,7 +470,11 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
stream = get_stream("Denmark", realm)
self.unsubscribe(self.example_user("hamlet"), "Denmark")
do_change_stream_permission(
- stream, invite_only=True, acting_user=self.example_user("hamlet")
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=self.example_user("hamlet"),
)
bot_info = {
@@ -493,7 +503,13 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
self.login("hamlet")
user_profile = self.example_user("hamlet")
stream = self.subscribe(user_profile, "Denmark")
- do_change_stream_permission(stream, invite_only=True, acting_user=user_profile)
+ do_change_stream_permission(
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=user_profile,
+ )
self.assert_num_bots_equal(0)
events: List[Mapping[str, Any]] = []
@@ -538,7 +554,11 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
stream = get_stream("Denmark", realm)
self.unsubscribe(self.example_user("hamlet"), "Denmark")
do_change_stream_permission(
- stream, invite_only=True, acting_user=self.example_user("hamlet")
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=self.example_user("hamlet"),
)
self.assert_num_bots_equal(0)
@@ -1215,7 +1235,13 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
self.login("hamlet")
user_profile = self.example_user("hamlet")
stream = self.subscribe(user_profile, "Denmark")
- do_change_stream_permission(stream, invite_only=True, acting_user=user_profile)
+ do_change_stream_permission(
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=user_profile,
+ )
bot_info = {
"full_name": "The Bot of Hamlet",
@@ -1242,7 +1268,11 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
stream = get_stream("Denmark", realm)
self.unsubscribe(self.example_user("hamlet"), "Denmark")
do_change_stream_permission(
- stream, invite_only=True, acting_user=self.example_user("hamlet")
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=self.example_user("hamlet"),
)
bot_info = {
@@ -1324,7 +1354,13 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
self.login("hamlet")
user_profile = self.example_user("hamlet")
stream = self.subscribe(user_profile, "Denmark")
- do_change_stream_permission(stream, invite_only=True, acting_user=user_profile)
+ do_change_stream_permission(
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=user_profile,
+ )
bot_info = {
"full_name": "The Bot of Hamlet",
@@ -1350,7 +1386,11 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
stream = get_stream("Denmark", realm)
self.unsubscribe(self.example_user("hamlet"), "Denmark")
do_change_stream_permission(
- stream, invite_only=True, acting_user=self.example_user("hamlet")
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=self.example_user("hamlet"),
)
bot_info = {
diff --git a/zerver/tests/test_message_flags.py b/zerver/tests/test_message_flags.py
index 206566b0685..821096b2d4f 100644
--- a/zerver/tests/test_message_flags.py
+++ b/zerver/tests/test_message_flags.py
@@ -1277,14 +1277,22 @@ class MessageAccessTests(ZulipTestCase):
# Guest user can access messages of subscribed private streams if
# history is public to subscribers
do_change_stream_permission(
- stream, invite_only=True, history_public_to_subscribers=True, acting_user=guest_user
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=True,
+ is_web_public=False,
+ acting_user=guest_user,
)
result = self.change_star(message_id)
self.assert_json_success(result)
# With history not public to subscribers, they can still see new messages
do_change_stream_permission(
- stream, invite_only=True, history_public_to_subscribers=False, acting_user=guest_user
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=guest_user,
)
self.login_user(normal_user)
message_id = [
@@ -1332,6 +1340,7 @@ class MessageAccessTests(ZulipTestCase):
stream,
invite_only=True,
history_public_to_subscribers=True,
+ is_web_public=False,
acting_user=self.example_user("cordelia"),
)
diff --git a/zerver/tests/test_message_topics.py b/zerver/tests/test_message_topics.py
index db6eed9bf3f..230718680df 100644
--- a/zerver/tests/test_message_topics.py
+++ b/zerver/tests/test_message_topics.py
@@ -130,7 +130,11 @@ class TopicHistoryTest(ZulipTestCase):
# Now make stream private, but subscribe cordelia
do_change_stream_permission(
- stream, invite_only=True, acting_user=self.example_user("cordelia")
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=self.example_user("cordelia"),
)
self.subscribe(self.example_user("cordelia"), stream.name)
@@ -232,7 +236,11 @@ class TopicDeleteTest(ZulipTestCase):
# Make stream private with limited history
do_change_stream_permission(
- stream, invite_only=True, history_public_to_subscribers=False, acting_user=user_profile
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=False,
+ is_web_public=False,
+ acting_user=user_profile,
)
# ADMIN USER subscribed now
@@ -266,7 +274,11 @@ class TopicDeleteTest(ZulipTestCase):
# Make the stream's history public to subscribers
do_change_stream_permission(
- stream, invite_only=True, history_public_to_subscribers=True, acting_user=user_profile
+ stream,
+ invite_only=True,
+ history_public_to_subscribers=True,
+ is_web_public=False,
+ acting_user=user_profile,
)
# Delete the topic should now remove all messages
result = self.client_post(
diff --git a/zerver/tests/test_reactions.py b/zerver/tests/test_reactions.py
index 32ecfa2f19f..bc7681e1bd9 100644
--- a/zerver/tests/test_reactions.py
+++ b/zerver/tests/test_reactions.py
@@ -544,7 +544,11 @@ class ReactionEventTest(ZulipTestCase):
# Make stream history public to subscribers
do_change_stream_permission(
- stream, invite_only=False, history_public_to_subscribers=True, acting_user=iago
+ stream,
+ invite_only=False,
+ history_public_to_subscribers=True,
+ is_web_public=False,
+ acting_user=iago,
)
# Since stream history is public to subscribers, reacting to
# message_before_id should notify all subscribers:
@@ -564,7 +568,13 @@ class ReactionEventTest(ZulipTestCase):
self.assert_json_success(remove)
# Make stream web_public as well.
- do_change_stream_permission(stream, is_web_public=True, acting_user=iago)
+ do_change_stream_permission(
+ stream,
+ invite_only=False,
+ history_public_to_subscribers=True,
+ is_web_public=True,
+ acting_user=iago,
+ )
# For is_web_public streams, events even on old messages
# should go to all subscribers, including guests like polonius.
with self.tornado_redirected_to_list(events, expected_num_events=1):