clean up file handle
This commit is contained in:
Родитель
3f76d69a78
Коммит
b23e54871c
|
@ -1,3 +1,5 @@
|
|||
from django.core.files.storage import default_storage as storage
|
||||
|
||||
import amo.tests
|
||||
from mkt.developers.utils import check_upload
|
||||
|
||||
|
@ -10,6 +12,6 @@ class TestCheckUpload(amo.tests.TestCase, amo.tests.AMOPaths):
|
|||
check_upload([], 'graphic', 'image/jpg')
|
||||
|
||||
def test_valid(self):
|
||||
errors, hash = check_upload(open(self.preview_image(), 'r'),
|
||||
'preview', 'image/png')
|
||||
assert not errors
|
||||
with storage.open(self.preview_image()) as f:
|
||||
errors, hash = check_upload(f, 'preview', 'image/png')
|
||||
assert not errors
|
||||
|
|
Загрузка…
Ссылка в новой задаче