Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.

Commit

Permalink
Add regression test for dynamically compiled subclasses of Template
Browse files Browse the repository at this point in the history
  • Loading branch information
R. Tyler Ballance committed Dec 26, 2009
1 parent 837d26c commit 5b32df4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cheetah/Tests/Template.py
Expand Up @@ -345,6 +345,16 @@ def runTest(self):
result = template.foo()
assert result == [4, 5, 1, 2, 3], (result, 'Unexpected result')

class SubclassSearchListTest(TemplateTest):
'''
Verify that if we subclass Template, we can still
use attributes on that subclass in the searchList
'''
def runTest(self):
class Sub(Template):
greeting = 'Hola'
tmpl = Sub('''When we meet, I say "${greeting}"''')
self.assertEquals(unicode(tmpl), 'When we meet, I say "Hola"')

##################################################
## if run from the command line ##
Expand Down

0 comments on commit 5b32df4

Please sign in to comment.