[Checkins] SVN: five.grok/trunk/src/five/grok/ftests/view/association Add tests for grok.template: this does work.
Sylvain Viollon
sylvain at infrae.com
Thu Oct 23 18:20:30 EDT 2008
Log message for revision 92520:
Add tests for grok.template: this does work.
Changed:
A five.grok/trunk/src/five/grok/ftests/view/association.py
A five.grok/trunk/src/five/grok/ftests/view/association_templates/
A five.grok/trunk/src/five/grok/ftests/view/association_templates/painting.pt
-=-
Added: five.grok/trunk/src/five/grok/ftests/view/association.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/view/association.py (rev 0)
+++ five.grok/trunk/src/five/grok/ftests/view/association.py 2008-10-23 22:20:29 UTC (rev 92520)
@@ -0,0 +1,25 @@
+"""
+ >>> from five.grok.ftests.view.association import *
+ >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
+
+ >>> from Products.Five.testbrowser import Browser
+ >>> browser = Browser()
+ >>> browser.handleErrors = False
+ >>> browser.open("http://localhost/manfred/@@art")
+ >>> print browser.contents
+ <html>
+ <body>
+ <h1>Art is beautiful!</h1>
+ </body>
+ </html>
+
+"""
+from five import grok
+
+class Mammoth(grok.Model):
+ pass
+
+class Art(grok.View):
+
+ grok.template("painting")
+
Added: five.grok/trunk/src/five/grok/ftests/view/association_templates/painting.pt
===================================================================
--- five.grok/trunk/src/five/grok/ftests/view/association_templates/painting.pt (rev 0)
+++ five.grok/trunk/src/five/grok/ftests/view/association_templates/painting.pt 2008-10-23 22:20:29 UTC (rev 92520)
@@ -0,0 +1,6 @@
+<html>
+<body>
+<h1>Art is beautiful!</h1>
+</body>
+</html>
+
More information about the Checkins
mailing list