[Erp5-report] r35275 nicolas - /erp5/trunk/products/ERP5OOo/tests/testOOoConversionCache.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed May 12 20:10:47 CEST 2010
Author: nicolas
Date: Wed May 12 20:10:47 2010
New Revision: 35275
URL: http://svn.erp5.org?rev=35275&view=rev
Log:
Follow new conversion cache storage typology (dictionary instead a list)
Modified:
erp5/trunk/products/ERP5OOo/tests/testOOoConversionCache.py
Modified: erp5/trunk/products/ERP5OOo/tests/testOOoConversionCache.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testOOoConversionCache.py?rev=35275&r1=35274&r2=35275&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testOOoConversionCache.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testOOoConversionCache.py [utf8] Wed May 12 20:10:47 2010
@@ -253,19 +253,22 @@
kw = {'format': 'html'}
#Generate one conversion
document.convert(**kw)
- cache_id = '%s%s' % (document._getCacheKey(),
- document.generateCacheId(**kw))
+ cache_id = document._getCacheKey(**kw)
cache_factory = document._getCacheFactory()
for cache_plugin in cache_factory.getCachePluginList():
cache_entry = cache_plugin.get(cache_id, DEFAULT_CACHE_SCOPE)
- md5sum, mime, data = cache_entry.getValue()
+ data_dict = cache_entry.getValue()
#get data from cache
- self.assertTrue(md5sum)
- self.assertTrue(mime)
- self.assertTrue(data)
+ self.assertTrue(data_dict['content_md5'])
+ self.assertTrue(data_dict['conversion_md5'])
+ self.assertTrue(data_dict['mime'])
+ self.assertTrue(data_dict['data'])
+ self.assertTrue(data_dict['date'])
+ self.assertTrue(data_dict['size'])
#Change md5 manualy
- cache_plugin.set(cache_id, DEFAULT_CACHE_SCOPE,
- ('Anything which is not md5', mime, data), 0, 0)
+ data_dict['content_md5'] = 'Anything which is not md5'
+ cache_plugin.set(cache_id, DEFAULT_CACHE_SCOPE, data_dict, 100, 0)
+ transaction.commit()
self.assertRaises(KeyError, document.getConversion, format='html')
def test_06_check_md5_is_updated(self):
More information about the Erp5-report
mailing list