From 16c3121bc8e2223aad504fd38ca691a5435af2e9 Mon Sep 17 00:00:00 2001 From: Mohit Gupta Date: Wed, 8 Jul 2020 05:59:18 +0530 Subject: [PATCH] tests: Move test_is_private_flag_not_leaked to test_message_flags.py. --- zerver/tests/test_message_flags.py | 14 ++++++++++++++ zerver/tests/test_messages.py | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/zerver/tests/test_message_flags.py b/zerver/tests/test_message_flags.py index 8714a3d713..1bc2c4236a 100644 --- a/zerver/tests/test_message_flags.py +++ b/zerver/tests/test_message_flags.py @@ -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']) diff --git a/zerver/tests/test_messages.py b/zerver/tests/test_messages.py index 17c4102090..7dbfe9bfac 100644 --- a/zerver/tests/test_messages.py +++ b/zerver/tests/test_messages.py @@ -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()