mirror of https://github.com/zulip/zulip.git
tests: Move test_is_private_flag_not_leaked to test_message_flags.py.
This commit is contained in:
parent
b0b3cf86ce
commit
16c3121bc8
|
@ -1217,3 +1217,17 @@ class MessageAccessTests(ZulipTestCase):
|
||||||
filtered_messages = bulk_access_messages(unsubscribed_user, messages)
|
filtered_messages = bulk_access_messages(unsubscribed_user, messages)
|
||||||
|
|
||||||
self.assertEqual(len(filtered_messages), 2)
|
self.assertEqual(len(filtered_messages), 2)
|
||||||
|
|
||||||
|
|
||||||
|
class PersonalMessagesFlagTest(ZulipTestCase):
|
||||||
|
def test_is_private_flag_not_leaked(self) -> None:
|
||||||
|
"""
|
||||||
|
Make sure `is_private` flag is not leaked to the API.
|
||||||
|
"""
|
||||||
|
self.login('hamlet')
|
||||||
|
self.send_personal_message(self.example_user("hamlet"),
|
||||||
|
self.example_user("cordelia"),
|
||||||
|
"test")
|
||||||
|
|
||||||
|
for msg in self.get_messages():
|
||||||
|
self.assertNotIn('is_private', msg['flags'])
|
||||||
|
|
|
@ -34,18 +34,6 @@ class PersonalMessagesTest(ZulipTestCase):
|
||||||
)
|
)
|
||||||
self.assertEqual(url, 'http://zulip.testserver/#narrow/pm-with/77,80-pm/near/555')
|
self.assertEqual(url, 'http://zulip.testserver/#narrow/pm-with/77,80-pm/near/555')
|
||||||
|
|
||||||
def test_is_private_flag_not_leaked(self) -> None:
|
|
||||||
"""
|
|
||||||
Make sure `is_private` flag is not leaked to the API.
|
|
||||||
"""
|
|
||||||
self.login('hamlet')
|
|
||||||
self.send_personal_message(self.example_user("hamlet"),
|
|
||||||
self.example_user("cordelia"),
|
|
||||||
"test")
|
|
||||||
|
|
||||||
for msg in self.get_messages():
|
|
||||||
self.assertNotIn('is_private', msg['flags'])
|
|
||||||
|
|
||||||
class MissedMessageTest(ZulipTestCase):
|
class MissedMessageTest(ZulipTestCase):
|
||||||
def test_presence_idle_user_ids(self) -> None:
|
def test_presence_idle_user_ids(self) -> None:
|
||||||
UserPresence.objects.all().delete()
|
UserPresence.objects.all().delete()
|
||||||
|
|
Loading…
Reference in New Issue