A simple test the make sure the traversal adapter for image scales is
working correctly.  First we have to create an image to start with:

  >>> self.setRoles(('Manager',))
  >>> data = self.getImage()
  >>> portal.invokeFactory('Image', id='foo', title='Foo', image=data)
  'foo'

Then we can use a testbrowser to access the image itself and a scaled down
version:

  >>> browser = self.getBrowser()
  >>> browser.open('http://nohost/plone/foo')
  >>> browser.contents
  'GIF89a...'
  >>> len(browser.contents) == len(data)
  True

Let's analyse the image a little further:

  >>> from PIL.Image import open
  >>> from StringIO import StringIO
  >>> image = open(StringIO(browser.contents))
  >>> image.format
  'GIF'
  >>> image.size
  (200, 200)

Now check the scaled version:

  >>> browser.open('http://nohost/plone/foo/image_thumb')
  >>> browser.contents
  '\x89PNG...'
  >>> image = open(StringIO(browser.contents))
  >>> image.format
  'PNG'
  >>> image.size
  (128, 128)

