[Zope-Checkins] CVS: Zope/lib/python/AccessControl/tests -
testSecurity.py:1.12
Tres Seaver
tseaver at zope.com
Fri Jan 16 13:18:52 EST 2004
Update of /cvs-repository/Zope/lib/python/AccessControl/tests
In directory cvs.zope.org:/tmp/cvs-serv15129/lib/python/AccessControl/tests
Modified Files:
testSecurity.py
Log Message:
- Merge fix / test for Collector #1186
=== Zope/lib/python/AccessControl/tests/testSecurity.py 1.11 => 1.12 ===
--- Zope/lib/python/AccessControl/tests/testSecurity.py:1.11 Mon Jan 27 17:55:27 2003
+++ Zope/lib/python/AccessControl/tests/testSecurity.py Fri Jan 16 13:18:51 2004
@@ -78,6 +78,33 @@
res = html(c=c)
assert res == '10', res
+ def testNewDTMLBuiltins(self):
+
+ NEW_BUILTINS_TEMPLATE = """
+ <dtml-var expr="_.min([1,2])">
+ <dtml-var expr="_.max([2,3])">
+ <dtml-var expr="_.sum([1,2,3,4])">
+ <dtml-var expr="[x for x in (1, 2, 3)]">
+ """
+
+ EXPECTED = ['1', '3', '10', '[1, 2, 3]']
+
+ #
+ # XXX: these expressions seem like they should work, with
+ # the following ExPECTED, but they raise Unauthorized
+ # on the 'next' name.
+ #
+ #<dtml-var expr="_.iter([1,2,3]).next()">
+ #<dtml-var expr="_.enumerate([1,2,3]).next()">
+ #
+ #EXPECTED = ['1', '3', '10', '1', '(0, 1)']
+
+ template = self.doc_class(NEW_BUILTINS_TEMPLATE)
+ res = template()
+ lines = filter(None, [x.strip() for x in res.split('\n')])
+
+ self.assertEqual(lines, EXPECTED)
+
# Note: we need more tests!
def test_suite():
More information about the Zope-Checkins
mailing list