[Checkins] SVN: grok/trunk/src/grok/tests/view/resourcetemplateandrender test that a view either has a render method or a template from the filesystem

Wolfgang Schnerring wosc at wosc.de
Mon Oct 16 08:48:35 EDT 2006


Log message for revision 70687:
  test that a view either has a render method or a template from the filesystem

Changed:
  A   grok/trunk/src/grok/tests/view/resourcetemplateandrender/
  A   grok/trunk/src/grok/tests/view/resourcetemplateandrender/cavepainting.pt
  A   grok/trunk/src/grok/tests/view/resourcetemplateandrender.py

-=-
Added: grok/trunk/src/grok/tests/view/resourcetemplateandrender/cavepainting.pt
===================================================================
--- grok/trunk/src/grok/tests/view/resourcetemplateandrender/cavepainting.pt	2006-10-16 12:44:18 UTC (rev 70686)
+++ grok/trunk/src/grok/tests/view/resourcetemplateandrender/cavepainting.pt	2006-10-16 12:48:34 UTC (rev 70687)
@@ -0,0 +1,5 @@
+<html>
+<body>
+A cave painting.
+</body>
+</html>

Added: grok/trunk/src/grok/tests/view/resourcetemplateandrender.py
===================================================================
--- grok/trunk/src/grok/tests/view/resourcetemplateandrender.py	2006-10-16 12:44:18 UTC (rev 70686)
+++ grok/trunk/src/grok/tests/view/resourcetemplateandrender.py	2006-10-16 12:48:34 UTC (rev 70687)
@@ -0,0 +1,20 @@
+"""
+A View may either have an associated template or a render-method. Here
+we check that this also works for templates in a resource-directory:
+
+  >>> grok.grok(__name__)
+  Traceback (most recent call last):
+    ...
+  GrokError: Multiple possible ways to render view
+  <class 'grok.tests.view.resourcetemplateandrender.CavePainting'>.
+  It has both a 'render' method as well as an associated template.
+
+"""
+import grok
+
+class Mammoth(grok.Model):
+    pass
+
+class CavePainting(grok.View):
+    def render(self):
+        pass



More information about the Checkins mailing list