Kaydet (Commit) 417ec4a6 authored tarafından Loic Bistuer's avatar Loic Bistuer

Fixed a ResourceWarning that wasn't properly fixed by the previous commit.

Also removed unused import in runtests.py.
üst b7de5f5d
...@@ -271,12 +271,10 @@ class FileUploadTests(TestCase): ...@@ -271,12 +271,10 @@ class FileUploadTests(TestCase):
file = tempfile.NamedTemporaryFile file = tempfile.NamedTemporaryFile
with file() as smallfile, file() as bigfile: with file() as smallfile, file() as bigfile:
# A small file (under the 5M quota) # A small file (under the 5M quota)
smallfile = tempfile.NamedTemporaryFile()
smallfile.write(b'a' * (2 ** 21)) smallfile.write(b'a' * (2 ** 21))
smallfile.seek(0) smallfile.seek(0)
# A big file (over the quota) # A big file (over the quota)
bigfile = tempfile.NamedTemporaryFile()
bigfile.write(b'a' * (10 * 2 ** 20)) bigfile.write(b'a' * (10 * 2 ** 20))
bigfile.seek(0) bigfile.seek(0)
......
...@@ -10,7 +10,7 @@ import warnings ...@@ -10,7 +10,7 @@ import warnings
import django import django
from django import contrib from django import contrib
from django.apps import apps, AppConfig from django.apps import apps
from django.conf import settings from django.conf import settings
from django.db import connection from django.db import connection
from django.test import TransactionTestCase, TestCase from django.test import TransactionTestCase, TestCase
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment