tests: Move test_is_private_flag_not_leaked to test_message_flags.py.

This commit is contained in:
Mohit Gupta 2020-07-08 05:59:18 +05:30 committed by Tim Abbott
parent b0b3cf86ce
commit 16c3121bc8
2 changed files with 14 additions and 12 deletions

View File

@ -1217,3 +1217,17 @@ class MessageAccessTests(ZulipTestCase):
filtered_messages = bulk_access_messages(unsubscribed_user, messages)
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'])

View File

@ -34,18 +34,6 @@ class PersonalMessagesTest(ZulipTestCase):
)
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):
def test_presence_idle_user_ids(self) -> None:
UserPresence.objects.all().delete()