[Checkins] SVN: Products.Five/branches/ajung-zpt-end-game/ Make tests respect the new unicode nature of templates

Philipp von Weitershausen philikon at philikon.de
Tue May 9 05:28:28 EDT 2006


Log message for revision 68058:
  Make tests respect the new unicode nature of templates
  

Changed:
  U   Products.Five/branches/ajung-zpt-end-game/browser/tests/pages.py
  U   Products.Five/branches/ajung-zpt-end-game/browser/tests/pages.txt
  U   Products.Five/branches/ajung-zpt-end-game/browser/tests/test_pages.py
  U   Products.Five/branches/ajung-zpt-end-game/viewlet/directives.txt

-=-
Modified: Products.Five/branches/ajung-zpt-end-game/browser/tests/pages.py
===================================================================
--- Products.Five/branches/ajung-zpt-end-game/browser/tests/pages.py	2006-05-09 09:27:57 UTC (rev 68057)
+++ Products.Five/branches/ajung-zpt-end-game/browser/tests/pages.py	2006-05-09 09:28:27 UTC (rev 68058)
@@ -22,35 +22,35 @@
 
     def eagle(self):
         """Docstring"""
-        return "The eagle has landed"
+        return u"The eagle has landed"
 
     def mouse(self):
         """Docstring"""
-        return "The mouse has been eaten by the eagle"
+        return u"The mouse has been eaten by the eagle"
 
 class FancyView(BrowserView):
     """Fancy, fancy stuff"""
 
     def view(self):
-        return "Fancy, fancy"
+        return u"Fancy, fancy"
 
 class CallView(BrowserView):
 
     def __call__(self):
-        return "I was __call__()'ed"
+        return u"I was __call__()'ed"
 
 class CallableNoDocstring:
 
     def __call__(self):
-        return "No docstring"
+        return u"No docstring"
 
 def function_no_docstring(self):
-    return "No docstring"
+    return u"No docstring"
 
 class NoDocstringView(BrowserView):
 
     def method(self):
-        return "No docstring"
+        return u"No docstring"
 
     function = function_no_docstring
 

Modified: Products.Five/branches/ajung-zpt-end-game/browser/tests/pages.txt
===================================================================
--- Products.Five/branches/ajung-zpt-end-game/browser/tests/pages.txt	2006-05-09 09:27:57 UTC (rev 68057)
+++ Products.Five/branches/ajung-zpt-end-game/browser/tests/pages.txt	2006-05-09 09:28:27 UTC (rev 68058)
@@ -35,13 +35,13 @@
   >>> isinstance(view, SimpleView)
   True
   >>> view()
-  'The eagle has landed'
+  u'The eagle has landed'
 
 A browser page that is a Page Template.
 
   >>> view = self.folder.unrestrictedTraverse('testoid/owl.html')
   >>> view()
-  '<p>2</p>\n'
+  u'<p>2</p>\n'
 
 A browser page that is a PageTemplate plus a view class:
 
@@ -49,7 +49,7 @@
   >>> isinstance(view, SimpleView)
   True
   >>> view()
-  '<p>The falcon has taken flight</p>\n'
+  u'<p>The falcon has taken flight</p>\n'
 
 Test pages that have been registered through the cumulative
 <browser:pages> directive:
@@ -58,13 +58,13 @@
   >>> isinstance(view, SimpleView)
   True
   >>> view()
-  'The eagle has landed'
+  u'The eagle has landed'
 
   >>> view = self.folder.unrestrictedTraverse('testoid/mouse-page.txt')
   >>> isinstance(view, SimpleView)
   True
   >>> view()
-  'The mouse has been eaten by the eagle'
+  u'The mouse has been eaten by the eagle'
 
 Zope 2 objects always need a docstring in order to be published.  Five
 adds a docstring automatically if a view method doesn't have it, but
@@ -98,7 +98,7 @@
 
   >>> view = self.folder.unrestrictedTraverse('testoid/seagull.html')
   >>> view()
-  '<html><head><title>bird macro</title></head><body>Color: gray</body></html>\n'
+  u'<html><head><title>bird macro</title></head><body>Color: gray</body></html>\n'
 
 Test whether old-style direct traversal still works with a
 five:traversable class:
@@ -298,7 +298,7 @@
   ... ''')
   >>> view = self.folder.unrestrictedTraverse('testoid/overridden_view')
   >>> view()
-  'The mouse has been eaten by the eagle'
+  u'The mouse has been eaten by the eagle'
 
 Test traversal to resources from within ZPT pages:
 

Modified: Products.Five/branches/ajung-zpt-end-game/browser/tests/test_pages.py
===================================================================
--- Products.Five/branches/ajung-zpt-end-game/browser/tests/test_pages.py	2006-05-09 09:27:57 UTC (rev 68057)
+++ Products.Five/branches/ajung-zpt-end-game/browser/tests/test_pages.py	2006-05-09 09:28:27 UTC (rev 68058)
@@ -39,7 +39,7 @@
       >>> isinstance(view, SimpleView)
       True
       >>> view()
-      'The eagle has landed'
+      u'The eagle has landed'
 
     This sucks, but we know it
 

Modified: Products.Five/branches/ajung-zpt-end-game/viewlet/directives.txt
===================================================================
--- Products.Five/branches/ajung-zpt-end-game/viewlet/directives.txt	2006-05-09 09:27:57 UTC (rev 68057)
+++ Products.Five/branches/ajung-zpt-end-game/viewlet/directives.txt	2006-05-09 09:28:27 UTC (rev 68058)
@@ -220,7 +220,7 @@
   ...     (content, request, view, manager), interfaces.IViewlet,
   ...     name='weather')
   >>> viewlet.render().strip()
-  '<div>sunny</div>'
+  u'<div>sunny</div>'
   >>> viewlet.extra_string_attributes
   u'can be specified'
 
@@ -253,7 +253,7 @@
   ...     (content, request, view, manager), interfaces.IViewlet,
   ...     name='weather2')
   >>> viewlet().strip()
-  '<div>sunny</div>'
+  u'<div>sunny</div>'
 
 Okay, so the template-driven cases work. But just specifying a class should
 also work:



More information about the Checkins mailing list