diff --git a/zerver/tests/test_message_edit.py b/zerver/tests/test_message_edit.py index 3f9693ed09..1d425039d7 100644 --- a/zerver/tests/test_message_edit.py +++ b/zerver/tests/test_message_edit.py @@ -282,7 +282,8 @@ class EditMessageTest(EditMessageTestCase): self.send_stream_message(self.notification_bot(realm), stream_name, "Message three") ) messages = [ - Message.objects.select_related().get(id=message_id) for message_id in message_ids + Message.objects.select_related(*Message.DEFAULT_SELECT_RELATED).get(id=message_id) + for message_id in message_ids ] # Check number of queries performed diff --git a/zerver/tests/test_message_flags.py b/zerver/tests/test_message_flags.py index 4e8125e46d..8a7c585d34 100644 --- a/zerver/tests/test_message_flags.py +++ b/zerver/tests/test_message_flags.py @@ -1454,7 +1454,8 @@ class MessageAccessTests(ZulipTestCase): message_ids = [message_one_id, message_two_id] messages = [ - Message.objects.select_related().get(id=message_id) for message_id in message_ids + Message.objects.select_related("recipient").get(id=message_id) + for message_id in message_ids ] with self.assert_database_query_count(2): @@ -1512,7 +1513,8 @@ class MessageAccessTests(ZulipTestCase): message_ids = [message_one_id, message_two_id] messages = [ - Message.objects.select_related().get(id=message_id) for message_id in message_ids + Message.objects.select_related("recipient").get(id=message_id) + for message_id in message_ids ] # All public stream messages are always accessible