Commit 9c66146f authored by Tristan Cavelier's avatar Tristan Cavelier

update Base_isConvertible unit test

parent bb669f59
...@@ -72,15 +72,28 @@ class TestDocumentWithPreConversion(TestDocument): ...@@ -72,15 +72,28 @@ class TestDocumentWithPreConversion(TestDocument):
reference='Embedded-XXX', reference='Embedded-XXX',
version='001', version='001',
language='en') language='en')
# empty image is not convertible
self.assertEqual(False, image.Base_isConvertible())
# image with data is convertible # draft image is not convertible
upload_file = makeFileUpload('cmyk_sample.jpg') upload_file = makeFileUpload('cmyk_sample.jpg')
image.edit(file=upload_file) image.edit(file=upload_file)
self.tic() self.tic()
self.assertEqual(False, image.Base_isConvertible())
# published image with data is convertible
image.publish()
self.tic()
self.assertEqual(True, image.Base_isConvertible()) self.assertEqual(True, image.Base_isConvertible())
image = self.portal.image_module.newContent(portal_type='Image',
reference='Embedded-YYY',
version='001',
language='en')
image.publish()
self.tic()
# published empty image is not convertible
self.assertEqual(False, image.Base_isConvertible())
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestDocumentWithPreConversion)) suite.addTest(unittest.makeSuite(TestDocumentWithPreConversion))
......
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