Project

General

Profile

Bug #854

TemplateLoop string representation fails

Added by Elmer de Looff about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Elmer de Looff
Category:
TemplateParser
Target version:
Start date:
2012-06-08
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

Currently, when attempting to print the template statements for a TemplateLoop, the current error is thrown:

Traceback (most recent call last):
  File "test_templateparser.py", line 574, in testLoopStringRepresentation
    self.assertTrue(str(self.tmpl(template)))
  File "/home/elmer/devel/uweb/templateparser.py", line 266, in __str__
    return ''.join(map(str, self))
  File "/home/elmer/devel/uweb/templateparser.py", line 531, in __str__
    self.alias, self.tag, ''.join(map(str, self)))
AttributeError: 'TemplateLoop' object has no attribute 'alias'

The string representation code needs a fix.

Associated revisions

Revision 241:4a1c7f573cc8 (diff)
Added by Elmer de Looff about 7 years ago

Fixed TemplateLoop string representation, and added a test for it. This resolves #854.

Revision 242:220a08030ef0 (diff)
Added by Elmer de Looff about 7 years ago

Small fix for neatness, this relates to issue #854.

Revision 243:c190424336d0 (diff)
Added by Elmer de Looff about 7 years ago

Added string representation tests, and added a small fix for the string representation of a TemplateConditional's 'else ' clause. This is related to issue #854.

History

#1 Updated by Elmer de Looff about 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 70

Applied in changeset 4a1c7f573cc8.

#2 Updated by Elmer de Looff about 7 years ago

  • Assignee changed from Elmer de Looff to Jan Klopper

Jan,

Please verify this also fixes the problem you encountered.

#3 Updated by Jan Klopper about 7 years ago

  • Status changed from Resolved to Closed
  • Assignee changed from Jan Klopper to Elmer de Looff
  • % Done changed from 70 to 100

correct, fix works as expected and intended.

#4 Updated by Elmer de Looff about 7 years ago

I've added string representation (echo) tests for the other template constructs as well. Barring whitespace differences, printing a template as string will echo its literal template text.

The exception to this is the {{ inline }} statement, which correctly only displays the inlined template content.

Also available in: Atom PDF