diff --git a/rest_framework/fields.py b/rest_framework/fields.py index a4cc7f3b2..a022fe092 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -181,7 +181,7 @@ class WritableField(Field): try: if self._use_files: - files = files or {} # For the case when files==None + files = files or {} native = files[field_name] else: native = data[field_name] diff --git a/rest_framework/tests/files.py b/rest_framework/tests/files.py index a98e33efb..446e23c07 100644 --- a/rest_framework/tests/files.py +++ b/rest_framework/tests/files.py @@ -46,6 +46,6 @@ class FileSerializerTests(TestCase): """ now = datetime.datetime.now() - serializer = UploadedFileSerializer(data={'created': now}, files=None) + serializer = UploadedFileSerializer(data={'created': now}) self.assertFalse(serializer.is_valid()) self.assertIn('file', serializer.errors)