[Checkins] SVN: five.pt/trunk/src/five/pt/tests/ Add some test coverage that Missing.MV, used for missing values in

Ross Patterson me at rpatterson.net
Sat Oct 23 15:55:29 EDT 2010


Log message for revision 117824:
  Add some test coverage that Missing.MV, used for missing values in
  Products.ZCatalog, can be used in templates without raising errors.
  
  This was an attempt to resolve LP#649343 but I discovered that the
  template which was causing the error was using zope.app.pagetemplate
  instead of Products.Five.browser.pagetemplatefile.  Once I switched I
  no longer for the MissingValue error so the ticket seems to be invalid
  or at least I can no longer reproduce it.  No harm in preserving the
  test coverage though.
  

Changed:
  A   five.pt/trunk/src/five/pt/tests/missing.pt
  U   five.pt/trunk/src/five/pt/tests/test_viewpagetemplatefile.py

-=-
Added: five.pt/trunk/src/five/pt/tests/missing.pt
===================================================================
--- five.pt/trunk/src/five/pt/tests/missing.pt	                        (rev 0)
+++ five.pt/trunk/src/five/pt/tests/missing.pt	2010-10-23 19:55:28 UTC (rev 117824)
@@ -0,0 +1,6 @@
+<div xmlns="http://www.w3.org/1999/xhtml"
+     xmlns:tal="http://xml.zope.org/namespaces/tal">
+    <span tal:content="structure options/missing">
+      MV
+    </span>
+</div>

Modified: five.pt/trunk/src/five/pt/tests/test_viewpagetemplatefile.py
===================================================================
--- five.pt/trunk/src/five/pt/tests/test_viewpagetemplatefile.py	2010-10-22 23:02:21 UTC (rev 117823)
+++ five.pt/trunk/src/five/pt/tests/test_viewpagetemplatefile.py	2010-10-23 19:55:28 UTC (rev 117824)
@@ -20,6 +20,9 @@
 class OptionsView(BrowserView):
     index = ViewPageTemplateFile('options.pt')
 
+class MissingView(BrowserView):
+    index = ViewPageTemplateFile('missing.pt')
+
 class TestPageTemplateFile(ZopeTestCase):
     def afterSetUp(self):
         from Products.Five import zcml
@@ -58,7 +61,13 @@
         self.failUnless("a : 1" in result)
         self.failUnless("c : abc" in result)
 
+    def test_MissingValue(self):
+        view = MissingView(self.folder, self.folder.REQUEST)
+        import Missing
+        result = view.index(missing=Missing.MV)
+        self.failUnless('<span></span>' in result)
 
+
 def test_suite():
     import sys
     return unittest.findTestCases(sys.modules[__name__])



More information about the checkins mailing list