Skip to content

Commit

Permalink
Adding VersatileImageFieldDescriptor.__set__ test
Browse files Browse the repository at this point in the history
  • Loading branch information
respondcreate committed Dec 24, 2014
1 parent 874bb00 commit b8b626e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Binary file added tests/media/python-logo-2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions tests/tests.py
Expand Up @@ -239,3 +239,20 @@ def test_widget_javascript(self):
self.png.image.thumbnail['300x300'].name
)
)

def test_VersatileImageFieldDescriptor__set__(self):
"""
Ensures VersatileImageFieldDescriptor.__set__ works as intended
"""
self.jpg.image = 'python-logo-2.jpg'
self.jpg.save()
self.assertEqual(
self.jpg.image.thumbnail['100x100'].url,
'/media/__sized__/python-logo-2-thumbnail-100x100.jpg'
)
self.jpg.image = 'python-logo.jpg'
self.jpg.save()
self.assertEqual(
self.jpg.image.thumbnail['100x100'].url,
'/media/__sized__/python-logo-thumbnail-100x100.jpg'
)

0 comments on commit b8b626e

Please sign in to comment.