Commit 33cae3c2 authored by Pere Cortes's avatar Pere Cortes Committed by Sebastien Robin

Cleanup added in testSafeImage

parent 840b6ec4
...@@ -47,7 +47,7 @@ class TestSafeImage(ERP5TypeTestCase): ...@@ -47,7 +47,7 @@ class TestSafeImage(ERP5TypeTestCase):
if getattr(self.image_module,'testTileTransformed',None) is not None: if getattr(self.image_module,'testTileTransformed',None) is not None:
self.image_module.manage_delObjects(ids=['testTileTransformed']) self.image_module.manage_delObjects(ids=['testTileTransformed'])
transaction.commit() transaction.commit()
self.tic() self.tic()
def _createImage(self): def _createImage(self):
portal = self.getPortalObject() portal = self.getPortalObject()
...@@ -62,7 +62,7 @@ class TestSafeImage(ERP5TypeTestCase): ...@@ -62,7 +62,7 @@ class TestSafeImage(ERP5TypeTestCase):
tile = self.image_module.newContent(portal_type='Image Tile',title='testTile', tile = self.image_module.newContent(portal_type='Image Tile',title='testTile',
id='testTile',file=tile_image,filename='testTile') id='testTile',file=tile_image,filename='testTile')
return tile return tile
def _createTileImageTransformed(self): def _createTileImageTransformed(self):
portal = self.getPortalObject() portal = self.getPortalObject()
tile_image_transformed = makeFileUpload('image_test.jpg') tile_image_transformed = makeFileUpload('image_test.jpg')
...@@ -70,14 +70,14 @@ class TestSafeImage(ERP5TypeTestCase): ...@@ -70,14 +70,14 @@ class TestSafeImage(ERP5TypeTestCase):
title='testTileTransformed',id='testTileTransformed', title='testTileTransformed',id='testTileTransformed',
file=tile_image_transformed,filename='testTileTransformed') file=tile_image_transformed,filename='testTileTransformed')
return tile_transformed return tile_transformed
def test_01_CreateImage(self): def test_01_CreateImage(self):
image = self._createImage() image = self._createImage()
self.assertTrue(image.hasData()) self.assertTrue(image.hasData())
transaction.commit() transaction.commit()
self.tic() self.tic()
self.assertNotEqual(image,None) self.assertNotEqual(image,None)
def test_02_CreateTileImage(self): def test_02_CreateTileImage(self):
"""" """"
We are going to check that tile image has following structure We are going to check that tile image has following structure
...@@ -140,3 +140,7 @@ class TestSafeImage(ERP5TypeTestCase): ...@@ -140,3 +140,7 @@ class TestSafeImage(ERP5TypeTestCase):
self.assertTrue(x.hasData()) self.assertTrue(x.hasData())
self.assertEquals(123,image_group['0-0-0'].getHeight()) self.assertEquals(123,image_group['0-0-0'].getHeight())
self.assertEquals(165,image_group['0-0-0'].getWidth()) self.assertEquals(165,image_group['0-0-0'].getWidth())
if getattr(self.image_module,'testTileTransformed',None) is not None:
self.image_module.manage_delObjects(ids=['testTileTransformed'])
transaction.commit()
self.tic()
4 5
\ No newline at end of file \ No newline at end of file
3 4
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment