[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/tests - testZPTPage.py:1.7
Christian Zagrodnick
cz@gocept.com
Sat, 7 Dec 2002 11:53:12 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/tests
In directory cvs.zope.org:/tmp/cvs-serv32108
Modified Files:
testZPTPage.py
Log Message:
added test for html stripping searchableText
=== Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/tests/testZPTPage.py 1.6 => 1.7 ===
--- Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/tests/testZPTPage.py:1.6 Thu Dec 5 12:37:42 2002
+++ Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/tests/testZPTPage.py Sat Dec 7 11:53:11 2002
@@ -51,11 +51,21 @@
def testSearchableText(self):
page = ZPTPage()
+ searchableText = getAdapter(page, ISearchableText)
+
utext = u'another test\n' # The source will grow a newline if ommited
-
+ html = u"<html><body>%s</body></html>\n" % (utext, )
+
page.setSource(utext)
- searchableText = getAdapter(page, ISearchableText)
self.failUnlessEqual(searchableText.getSearchableText(), [utext])
+
+ page.setSource(html, content_type='text/html')
+ self.assertEqual(searchableText.getSearchableText(), [utext+'\n'])
+
+ page.setSource(html, content_type='text/plain')
+ self.assertEqual(searchableText.getSearchableText(), [html])
+
+
def testZPTRendering(self):
page = ZPTPage()