Commit 04488450 authored by Nicolas Delaby's avatar Nicolas Delaby

Follow new conversion cache storage typology (dictionary instead a list)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35275 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 36f2f76f
......@@ -253,19 +253,22 @@ class TestDocumentConversionCache(TestDocumentMixin):
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):
......
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