Commit 52b72a69 authored by Evan Simpson's avatar Evan Simpson

Added unit tests for the behavior of tal:attributes with 'default'.

Fixed Collector #580 by making evaluateBoolean() an alias for evaluate().
parent 2e153b46
......@@ -6,6 +6,8 @@ Zope Changes
Bugs Fixed
- Collector #580: TALES evaluateBoolean() was squishing 'default'.
- Collector #581: TALES Path traversal should not special-case a blank
string in the second element position. It now skips directly
to item access when a path element is blank or has a leading '_'.
......
......@@ -15,7 +15,7 @@
An implementation of a generic TALES engine
"""
__version__='$Revision: 1.34 $'[11:-2]
__version__='$Revision: 1.35 $'[11:-2]
import re, sys, ZTUtils
from MultiMapping import MultiMapping
......@@ -214,9 +214,7 @@ class Context:
return expression(self)
evaluateValue = evaluate
def evaluateBoolean(self, expr):
return not not self.evaluate(expr)
evaluateBoolean = evaluate
def evaluateText(self, expr):
text = self.evaluate(expr)
......
......@@ -8,17 +8,22 @@
<img ismap tal:attributes="ismap true">
<img ismap tal:attributes="ismap false">
<img ismap tal:attributes="ismap nothing">
<img ismap tal:attributes="ismap default">
<img ismap="foo" tal:attributes="ismap true">
<img ismap="foo" tal:attributes="ismap false">
<img ismap="foo" tal:attributes="ismap nothing">
<img ismap="foo" tal:attributes="ismap default">
<img tal:attributes="ismap true">
<img tal:attributes="ismap false">
<img tal:attributes="ismap nothing">
<img tal:attributes="ismap default">
<span tal:define="global x string:x.gif" />
<img src="foo">
<img src="foo" tal:attributes="src x">
<img src="foo" tal:attributes="src nothing">
<img src="foo" tal:attributes="src default">
<img tal:attributes="src default">
......@@ -8,17 +8,22 @@
<img ismap="ismap">
<img>
<img>
<img ismap="ismap">
<img ismap="ismap">
<img>
<img>
<img ismap="foo">
<img ismap="ismap">
<img>
<img>
<img>
<span />
<img src="foo">
<img src="x.gif">
<img>
<img src="foo">
<img>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment