Commit 642e3265 authored by Nicolas Delaby's avatar Nicolas Delaby

Remove clearConversionCache call

Add a test to check expected behaviour of new refresh caching process.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34883 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 142405c5
...@@ -1577,10 +1577,6 @@ style=3D'color:black'>05D65812<o:p></o:p></span></p> ...@@ -1577,10 +1577,6 @@ style=3D'color:black'>05D65812<o:p></o:p></span></p>
transaction.commit() transaction.commit()
self.tic() self.tic()
document.clearConversionCache()
transaction.commit()
self.tic()
class ThreadWrappedConverter(Thread): class ThreadWrappedConverter(Thread):
"""Use this class to run different convertion """Use this class to run different convertion
inside distinct Thread. inside distinct Thread.
...@@ -1641,6 +1637,38 @@ style=3D'color:black'>05D65812<o:p></o:p></span></p> ...@@ -1641,6 +1637,38 @@ style=3D'color:black'>05D65812<o:p></o:p></span></p>
result_list.append(i) result_list.append(i)
self.assertEquals(result_list, []) self.assertEquals(result_list, [])
def test_conversionCache_reseting(self):
"""Chack that modifying a document with edit method,
compute a new cache key and refresh cached conversions.
"""
web_page_portal_type = 'Web Page'
module = self.portal.getDefaultModule(web_page_portal_type)
web_page = module.newContent(portal_type=web_page_portal_type)
html_content = """<html>
<head>
<title>My dirty title</title>
<style type="text/css">
a {color: #FFAA44;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>
<h1>My splendid title</h1>
</div>
<script type="text/javascript" src="http://example.com/something.js"/>
</body>
</html>
"""
web_page.edit(text_content=html_content)
web_page.convert(format='txt')
self.assertTrue(web_page.hasConversion(format='txt'))
web_page.edit(title='Bar')
self.assertFalse(web_page.hasConversion(format='txt'))
web_page.convert(format='txt')
web_page.edit()
self.assertFalse(web_page.hasConversion(format='txt'))
class TestDocumentWithSecurity(TestDocumentMixin): class TestDocumentWithSecurity(TestDocumentMixin):
username = 'yusei' username = 'yusei'
......
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