mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed a couple unclosed file warnings in tests
This commit is contained in:
@@ -567,9 +567,10 @@ class InconsistentGetImageDimensionsBug(unittest.TestCase):
|
||||
from django.core.files.images import ImageFile
|
||||
|
||||
img_path = os.path.join(os.path.dirname(upath(__file__)), "test.png")
|
||||
image = ImageFile(open(img_path, 'rb'))
|
||||
image_pil = Image.open(img_path)
|
||||
size_1, size_2 = get_image_dimensions(image), get_image_dimensions(image)
|
||||
with open(img_path, 'rb') as file:
|
||||
image = ImageFile(file)
|
||||
image_pil = Image.open(img_path)
|
||||
size_1, size_2 = get_image_dimensions(image), get_image_dimensions(image)
|
||||
self.assertEqual(image_pil.size, size_1)
|
||||
self.assertEqual(size_1, size_2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user