Commit 06736d76 authored by Julien Muchembled's avatar Julien Muchembled

Fix test_20_reStructuredText

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41729 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9e61edf0
......@@ -148,6 +148,10 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin,
text_content = self.getTextContent()
if text_content:
kw['format'] = format
convert_kw = {}
# PortalTransforms does not accept empty values for 'encoding' parameter
if charset:
kw['charset'] = convert_kw['encoding'] = charset
if not self.hasConversion(**kw):
portal_transforms = getToolByName(portal, 'portal_transforms')
filename = self.getStandardFilename(format=format)
......@@ -157,7 +161,7 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin,
object=self, context=self,
filename=filename,
mimetype=src_mimetype,
encoding=charset)
**convert_kw)
if result is None:
raise ConversionError('TextDocument conversion error. '
'portal_transforms failed to convert '
......
......@@ -1313,16 +1313,10 @@ Hé Hé Hé!""", page.asText().strip())
self.assertEquals(1, getattr(website, 'person_module').isEditableMode())
def test_20_reStructuredText(self):
def clearAllCache():
self.portal.portal_caches.clearAllCache()
getTransactionalVariable().clear()
web_page = self.portal.web_page_module.newContent(portal_type='Web Page',
content_type='text/x-rst',
text_content="`foo`")
clearAllCache()
content_type='text/x-rst')
web_page.edit(text_content="`foo`")
self.assertTrue('<cite>foo</cite>' in web_page.asEntireHTML(charset='utf-8'))
# XXX: It currently fails if charset is not given. Is it normal ?
clearAllCache()
self.assertTrue('<cite>foo</cite>' in web_page.asEntireHTML())
......
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