Commit cb291c23 authored by Nicolas Delaby's avatar Nicolas Delaby

Test that cache of temp objects are not mixed

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28084 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 01e8a580
...@@ -171,11 +171,11 @@ class TestDocumentConversionCache(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -171,11 +171,11 @@ class TestDocumentConversionCache(ERP5TypeTestCase, ZopeTestCase.Functional):
self.assertTrue(document.hasConversion(format=format), 'Cache Storage failed for %s' % (format)) self.assertTrue(document.hasConversion(format=format), 'Cache Storage failed for %s' % (format))
self.assertTrue(document.getConversionSize(format=format)) self.assertTrue(document.getConversionSize(format=format))
def test_02_PersistentCacheConversionOfTempObject(self): def test_02_VolatileCacheConversionOfTempObject(self):
""" """
Test Conversion Cache mechanism Test Conversion Cache mechanism
""" """
print '\nPersistent Cache Conversion Of Temp Objects' print '\nVolatile Cache Conversion of temp objects'
filename = 'TEST-en-002.doc' filename = 'TEST-en-002.doc'
file = makeFileUpload(filename) file = makeFileUpload(filename)
...@@ -205,7 +205,25 @@ class TestDocumentConversionCache(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -205,7 +205,25 @@ class TestDocumentConversionCache(ERP5TypeTestCase, ZopeTestCase.Functional):
self.assertTrue(document.hasConversion(format=format), 'Cache Storage failed for %s' % (format)) self.assertTrue(document.hasConversion(format=format), 'Cache Storage failed for %s' % (format))
self.assertTrue(document.getConversionSize(format=format)) self.assertTrue(document.getConversionSize(format=format))
def test_03_CacheConversionOfTempObjectIsNotMixed(self):
"""
Test Conversion Cache mechanism
"""
print '\nCache Conversion of temp objects is not mixed'
filename1 = 'TEST-en-002.doc'
filename2 = 'TEST-en-002.odt'
file1 = makeFileUpload(filename1)
file2 = makeFileUpload(filename2)
document1 = self.portal.portal_contributions.newContent(file=file1, temp_object=1)
document1.convertToBaseFormat()
document2 = self.portal.portal_contributions.newContent(file=file2, temp_object=1)
document2.convertToBaseFormat()
format = 'pdf'
document1.convert(format=format)
document2.convert(format=format)
self.assertNotEqual(document1.getConversion(format=format),
document2.getConversion(format=format))
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestDocumentConversionCache)) suite.addTest(unittest.makeSuite(TestDocumentConversionCache))
......
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