Comment 4 for bug 665748

Revision history for this message
Ross Patterson (rossp) wrote :

That patch causes a failure in z3c.pt:

Failure in test /home/xen/src/work/ovt.buildout/src/Chameleon/src/chameleon/zpt/language.txt
Traceback (most recent call last):
  File "/usr/lib/python2.6/unittest.py", line 279, in run
    testMethod()
  File "/usr/lib/python2.6/doctest.py", line 2163, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for language.txt
  File "/home/xen/src/work/ovt.buildout/src/Chameleon/src/chameleon/zpt/language.txt", line 0

----------------------------------------------------------------------
File "/home/xen/src/work/ovt.buildout/src/Chameleon/src/chameleon/zpt/language.txt", line 281, in language.txt
Failed example:
    print render("""\
    <div xmlns="http://www.w3.org/1999/xhtml"
         xmlns:tal="http://xml.zope.org/namespaces/tal">
      <tal:example replace="'Hello World!'" />
      <tal:example tal:replace="'Hello World!'" />
      <tal:div content="'Hello World!'" />
      <tal:multiple repeat="i range(3)" replace="i" />
      <tal:div condition="True">True</tal:div>
    </div>""")
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.6/doctest.py", line 1253, in __run
        compileflags, 1) in test.globs
      File "<doctest language.txt[18]>", line 9, in <module>
        </div>""")
      File "<doctest language.txt[2]>", line 4, in render
        return func(**kwargs)
      File "/home/xen/src/work/ovt.buildout/src/Chameleon/src/chameleon/core/testing.py", line 77, in render
        result = func(econtext, rcontext)
      File "/tmp/tmpwyRe8g/tmpJoA4w_.py", line 120, in render
      File "/home/xen/src/work/ovt.buildout/src/Chameleon/src/chameleon/core/utils.py", line 332, in __getitem__
        raise NameError(key)
    NameError: i

Which makes sense. the question is, does the reference implementation support tal:replace/content/define/attributes="i" in the same element as tal:repeat="i ..."?