mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #21217 -- Avoid connecting (pre|post)_init
signals to abstract senders.
This commit is contained in:
parent
dc3d2ac98c
commit
948d209ada
5 changed files with 71 additions and 26 deletions
|
@ -134,7 +134,7 @@ class ImageFieldTests(ImageFieldTestMixin, TestCase):
|
|||
p = self.PersonModel.objects.get(name="Joan")
|
||||
path = p.mugshot.path
|
||||
shutil.move(path, path + '.moved')
|
||||
p2 = self.PersonModel.objects.get(name="Joan")
|
||||
self.PersonModel.objects.get(name="Joan")
|
||||
|
||||
def test_delete_when_missing(self):
|
||||
"""
|
||||
|
@ -412,7 +412,7 @@ class TwoImageFieldTests(ImageFieldTestMixin, TestCase):
|
|||
# was opened.
|
||||
self.assertEqual(p.mugshot.was_opened, False)
|
||||
self.assertEqual(p.headshot.was_opened, False)
|
||||
self.check_dimensions(p, 4, 8,'mugshot')
|
||||
self.check_dimensions(p, 4, 8, 'mugshot')
|
||||
self.check_dimensions(p, 8, 4, 'headshot')
|
||||
# After checking dimensions on the image fields, the files will
|
||||
# have been opened.
|
||||
|
@ -422,7 +422,7 @@ class TwoImageFieldTests(ImageFieldTestMixin, TestCase):
|
|||
# check dimensions again, the file should not have opened.
|
||||
p.mugshot.was_opened = False
|
||||
p.headshot.was_opened = False
|
||||
self.check_dimensions(p, 4, 8,'mugshot')
|
||||
self.check_dimensions(p, 4, 8, 'mugshot')
|
||||
self.check_dimensions(p, 8, 4, 'headshot')
|
||||
self.assertEqual(p.mugshot.was_opened, False)
|
||||
self.assertEqual(p.headshot.was_opened, False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue