[Erp5-report] r34883 nicolas - /erp5/trunk/products/ERP5OOo/tests/testDms.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Apr 30 12:04:51 CEST 2010
Author: nicolas
Date: Fri Apr 30 12:04:45 2010
New Revision: 34883
URL: http://svn.erp5.org?rev=34883&view=rev
Log:
Remove clearConversionCache call
Add a test to check expected behaviour of new refresh caching process.
Modified:
erp5/trunk/products/ERP5OOo/tests/testDms.py
Modified: erp5/trunk/products/ERP5OOo/tests/testDms.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testDms.py?rev=34883&r1=34882&r2=34883&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] Fri Apr 30 12:04:45 2010
@@ -1577,10 +1577,6 @@
transaction.commit()
self.tic()
- document.clearConversionCache()
- transaction.commit()
- self.tic()
-
class ThreadWrappedConverter(Thread):
"""Use this class to run different convertion
inside distinct Thread.
@@ -1640,6 +1636,38 @@
if not document.hasConversion(**convert_kw):
result_list.append(i)
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):
More information about the Erp5-report
mailing list