mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-16 21:30:23 +00:00
Add failing test for source_save signal w/o source
This is like the test contributed by @saulshanabrook in #214, but catches the bug closer to its source. (A more unit-y unit test.)
This commit is contained in:
parent
c6a0a13c45
commit
404fed58ec
1 changed files with 15 additions and 0 deletions
|
|
@ -27,6 +27,21 @@ def test_source_saved_signal():
|
|||
eq_(receiver.count, 1)
|
||||
|
||||
|
||||
def test_no_source_saved_signal():
|
||||
"""
|
||||
Creating a new instance without an image shouldn't cause the source_saved
|
||||
signal to be dispatched.
|
||||
|
||||
https://github.com/jdriscoll/django-imagekit/issues/214
|
||||
|
||||
"""
|
||||
source_group = ImageFieldSourceGroup(ImageModel, 'image')
|
||||
receiver = make_counting_receiver(source_group)
|
||||
source_saved.connect(receiver)
|
||||
ImageModel.objects.create()
|
||||
eq_(receiver.count, 0)
|
||||
|
||||
|
||||
def test_abstract_model_signals():
|
||||
"""
|
||||
Source groups created for abstract models must cause signals to be
|
||||
|
|
|
|||
Loading…
Reference in a new issue