Commit d4f55a47 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Check if Web Page's asText() returns utf-8 string correctly and if it is

wrapped by certian column width.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28940 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e66d7a6f
......@@ -197,6 +197,24 @@ class TestERP5Web(ERP5TypeTestCase, ZopeTestCase.Functional):
self.assertEquals('text/html', page.getTextFormat())
self.assertEquals('<b>OK</b>', page.getTextContent())
def test_02a_WebPageAsText(self, quiet=quiet, run=run_all_test):
"""
Check if Web Page's asText() returns utf-8 string correctly and
if it is wrapped by certian column width.
"""
if not run: return
if not quiet:
message = '\ntest_02a_WebPageAsText'
ZopeTestCase._print(message)
# disable portal_transforms cache
self.portal.portal_transforms.max_sec_in_cache=-1
page = self.web_page_module.newContent(portal_type='Web Page')
page.edit(text_content='<p>Hé Hé Hé!</p>')
self.assertEquals('Hé Hé Hé!', page.asText().strip())
page.edit(text_content='<p>Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé!</p>')
self.assertEquals("""Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé Hé
Hé Hé Hé!""", page.asText().strip())
def test_03_CreateWebSiteUser(self, quiet=quiet, run=run_all_test):
"""
Create Web site User.
......
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