Skip to content

Commit ee29aa4

Browse files
committed
Fix tests/test_parsers.py::TestFileUploadParser::test_parse
1 parent 51215f9 commit ee29aa4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_parsers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ def test_parse(self):
6262
self.stream.seek(0)
6363
data_and_files = parser.parse(self.stream, None, self.parser_context)
6464
file_obj = data_and_files.files['file']
65-
assert file_obj._size == 14
65+
try:
66+
size = file_obj.size
67+
except AttributeError: # before Django 2.1 _size was private
68+
size = file_obj._size
69+
assert size == 14
6670

6771
def test_parse_missing_filename(self):
6872
"""

0 commit comments

Comments
 (0)