Commit 40b74a22 authored by Nicolas Delaby's avatar Nicolas Delaby

Test key used for DistributedRamCache are escaped

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28981 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 75b0f02e
......@@ -332,6 +332,29 @@ class TestDocumentConversionCache(ERP5TypeTestCase, ZopeTestCase.Functional):
document.edit(file=file2)
self.assertNotEqual(md5sum, document.getContentMd5())
def test_07_check_cache_key_is_escaped(self):
"""
Check that key (based on path of document) support unauthorised chars
"""
print '\nCheck key (based on path) support unauthorised chars'
default_pref = self.portal.portal_preferences.default_site_preference
default_pref.setPreferredConversionCacheFactory('dms_cache_factory')
#old preferred value is still cached
self.portal.portal_caches.clearAllCache()
transaction.commit()
self.tic()
filename = 'TEST-en-002.doc'
file = makeFileUpload(filename)
document_id = 'an id with spaces'
document = self.portal.portal_contributions.newContent(id=document_id, file=file)
transaction.commit()
self.tic()
document_url = document.getRelativeUrl()
document = self.portal.restrictedTraverse(document_url)
self.assertEquals(document.getId(), document_id)
document.convert(format='txt')
self.assertTrue(document.getConversion(format='txt'))
def test_suite():
suite = unittest.TestSuite()
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