aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_files.py
diff options
context:
space:
mode:
authorTom Christie2014-08-19 13:28:07 +0100
committerTom Christie2014-08-19 13:28:07 +0100
commitbf09c32de8f9d528f83e9cb7a2773d1f4c9ab563 (patch)
tree334c85c136fe1dc010f8d7860b9431b3a9d87e56 /tests/test_files.py
parente385a7b8eb6e538698f28128e43fe8bfaefd4e97 (diff)
downloaddjango-rest-framework-bf09c32de8f9d528f83e9cb7a2773d1f4c9ab563.tar.bz2
Code linting and added runtests.py
Diffstat (limited to 'tests/test_files.py')
-rw-r--r--tests/test_files.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/test_files.py b/tests/test_files.py
index 78f4cf42..af110df9 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -85,11 +85,8 @@ class FileSerializerTests(TestCase):
"""
Validation should still function when no data dictionary is provided.
"""
- now = datetime.datetime.now()
- file = BytesIO(six.b('stuff'))
- file.name = 'stuff.txt'
- file.size = len(file.getvalue())
- uploaded_file = UploadedFile(file=file, created=now)
-
- serializer = UploadedFileSerializer(files={'file': file})
+ uploaded_file = BytesIO(six.b('stuff'))
+ uploaded_file.name = 'stuff.txt'
+ uploaded_file.size = len(uploaded_file.getvalue())
+ serializer = UploadedFileSerializer(files={'file': uploaded_file})
self.assertFalse(serializer.is_valid())