From 50bbf71bbd51616e2ce48785336ca3746fbe5f24 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 1 May 2026 21:15:12 -0400 Subject: [PATCH] Removed integer pk assumption from file_uploads test. The test was incompatible with MongoDB's bson.ObjectId. --- tests/file_uploads/tests.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index 6374b4cee62c..a5c9c36ac5a4 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -800,8 +800,7 @@ def test_filename_case_preservation(self): "multipart/form-data; boundary=%(boundary)s" % vars, ) self.assertEqual(response.status_code, 200) - id = int(response.content) - obj = FileModel.objects.get(pk=id) + obj = FileModel.objects.get(pk=response.content.decode()) # The name of the file uploaded and the file stored in the server-side # shouldn't differ. self.assertEqual(os.path.basename(obj.testfile.path), "MiXeD_cAsE.txt")