mirror of https://github.com/zulip/zulip.git
test: Check json_fetch_raw_message raises error.
This commit adds a check to verify that json_fetch_raw_message raises error when enable_spectator_access is False.
This commit is contained in:
parent
733cad1f5c
commit
30c190a120
|
@ -351,6 +351,15 @@ class EditMessageTest(EditMessageTestCase):
|
||||||
result, "Not logged in: API authentication or user session required", 401
|
result, "Not logged in: API authentication or user session required", 401
|
||||||
)
|
)
|
||||||
|
|
||||||
|
do_set_realm_property(
|
||||||
|
user_profile.realm, "enable_spectator_access", False, acting_user=None
|
||||||
|
)
|
||||||
|
result = self.client_get("/json/messages/" + str(web_public_stream_msg_id))
|
||||||
|
self.assert_json_error(
|
||||||
|
result, "Not logged in: API authentication or user session required", 401
|
||||||
|
)
|
||||||
|
do_set_realm_property(user_profile.realm, "enable_spectator_access", True, acting_user=None)
|
||||||
|
|
||||||
# Verify success with web-public stream and default SELF_HOSTED plan type.
|
# Verify success with web-public stream and default SELF_HOSTED plan type.
|
||||||
result = self.client_get("/json/messages/" + str(web_public_stream_msg_id))
|
result = self.client_get("/json/messages/" + str(web_public_stream_msg_id))
|
||||||
self.assert_json_success(result)
|
self.assert_json_success(result)
|
||||||
|
|
Loading…
Reference in New Issue