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")