Skip to content

Commit 50bbf71

Browse files
timgrahamjacobtylerwalls
authored andcommitted
Removed integer pk assumption from file_uploads test.
The test was incompatible with MongoDB's bson.ObjectId.
1 parent 5dfb658 commit 50bbf71

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

tests/file_uploads/tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,7 @@ def test_filename_case_preservation(self):
800800
"multipart/form-data; boundary=%(boundary)s" % vars,
801801
)
802802
self.assertEqual(response.status_code, 200)
803-
id = int(response.content)
804-
obj = FileModel.objects.get(pk=id)
803+
obj = FileModel.objects.get(pk=response.content.decode())
805804
# The name of the file uploaded and the file stored in the server-side
806805
# shouldn't differ.
807806
self.assertEqual(os.path.basename(obj.testfile.path), "MiXeD_cAsE.txt")

0 commit comments

Comments
 (0)