diff options
| author | Tom Christie | 2014-08-19 16:15:48 +0100 |
|---|---|---|
| committer | Tom Christie | 2014-08-19 16:15:48 +0100 |
| commit | 390061bed0991892dfa6c9b953fffc1bd15564a9 (patch) | |
| tree | 19b77e0e7b2c3559e7a427196364e7d1060b08b5 /tests/test_files.py | |
| parent | e385a7b8eb6e538698f28128e43fe8bfaefd4e97 (diff) | |
| parent | 2d2737f367c241c29c9c3913f2dba986c7c9a4a5 (diff) | |
| download | django-rest-framework-390061bed0991892dfa6c9b953fffc1bd15564a9.tar.bz2 | |
Merge pull request #1780 from tomchristie/pytest-tweaks
Added `runtests.py` and `flake8` code linting.
Diffstat (limited to 'tests/test_files.py')
| -rw-r--r-- | tests/test_files.py | 11 |
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()) |
