Permalink
Browse files

This time we really create images.

Also tests got updated

svn path=/plone.app.blob/branches/do3cc-issue34/; revision=33906
  • Loading branch information...
1 parent 30a5853 commit a8454c3c231a409dc29ef222af975b1a1fd5e582 Patrick Gerken committed Feb 10, 2010
Showing with 7 additions and 3 deletions.
  1. +2 −2 src/plone/app/blob/mixins.py
  2. +5 −1 src/plone/app/blob/tests/test_scaling.py
View
4 src/plone/app/blob/mixins.py
@@ -40,8 +40,8 @@ def createScales(self, instance, **kwargs):
sizes = self.getAvailableSizes(instance)
handler = IImageScaleHandler(self, None)
if handler is not None:
- for scale in sizes.values():
- handler.getScale(instance, scale)
+ for scale, (width, height) in sizes.items():
+ handler.createScale(instance, scale, width, height)
class ImageMixin(ATCTImageTransform):
""" mixin class for methods needed for image content """
View
6 src/plone/app/blob/tests/test_scaling.py
@@ -100,7 +100,11 @@ def testImageRecreation(self):
atct_tool = getToolByName(self.portal, 'portal_atct')
atct_tool.recreateImageScales()
sizes = image.getField('image').getAvailableSizes(image)
- self.failUnless('thumb' in sizes.keys())
+ self.assertEquals(len(sizes), self.counter)
+ traverse = folder.REQUEST.traverseName
+ thumb = traverse(image, 'image_thumb')
+ blob = getattr(image, blobScalesAttr)['image']['thumb']['blob']
+ self.failUnless(isinstance(blob, Blob), 'no blob?')
def testBlobCreation(self):
data = getData('image.gif')

0 comments on commit a8454c3

Please sign in to comment.