tests: Add an explicit order_by to prevent flakes.

Without an order_by, this can fail spuriously.
This commit is contained in:
Alex Vandiver
2020-08-17 18:27:10 -07:00
committed by Steve Howell
parent b38353f3ff
commit 0078f16f06

View File

@@ -63,7 +63,7 @@ class TransferUploadsToS3Test(ZulipTestCase):
with self.assertLogs(level="INFO"):
transfer_message_files_to_s3(1)
attachments = Attachment.objects.all()
attachments = Attachment.objects.all().order_by("id")
self.assertEqual(len(list(bucket.objects.all())), 2)
self.assertEqual(bucket.Object(attachments[0].path_id).get()['Body'].read(), b'zulip1!')