Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Test that test function is available.
Browse files Browse the repository at this point in the history
  • Loading branch information
malthe committed Jul 15, 2011
1 parent 33265ce commit 512d5a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/five/pt/tests/locals.pt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal">
<div tal:replace="string:view:${view/available}" />
<div tal:replace="string:view:${view/available|nothing}" />
<div tal:replace="python:'here==context:'+str(here==context)" />
<div tal:replace="python:'here==container:'+str(here==container)" />
<div tal:replace="string:root:${root/getPhysicalPath}" />
<div tal:replace="string:nothing:${nothing}" />
<div tal:define="cgi python:modules['cgi']"
tal:replace="python: dir(cgi)" />
<div tal:define="test nocall: test|nothing" tal:replace="python: test" />
<div tal:define="same nocall: same_type|nothing" tal:replace="python: same" />
</div>
6 changes: 6 additions & 0 deletions src/five/pt/tests/test_pagetemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def _makeOne(self, name):
return PageTemplateFile(os.path.join(path, name)).\
__of__(self.app)

def test_locals(self):
template = self._makeOne('locals.pt')
result = template()
self.failUnless('function test' in result)
self.failUnless('function same_type' in result)

def test_locals_base(self):
template = self._makeOne('locals_base.pt')
result = template()
Expand Down

0 comments on commit 512d5a5

Please sign in to comment.