summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@monkeypox.org>2009-12-26 14:02:58 -0800
committerR. Tyler Ballance <tyler@monkeypox.org>2009-12-26 14:02:58 -0800
commit5b32df45da4202f6bcd1465cc8ffcb640c55956f (patch)
treee79bd744be9e6882d1f0e4e1b319a4e7e0e51f67
parent837d26cb8cd754d3a44a9170db365a2dab2cfcc1 (diff)
downloadpython-cheetah-5b32df45da4202f6bcd1465cc8ffcb640c55956f.tar.gz
Add regression test for dynamically compiled subclasses of Template
-rw-r--r--cheetah/Tests/Template.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/cheetah/Tests/Template.py b/cheetah/Tests/Template.py
index 331c0f9..89c84ed 100644
--- a/cheetah/Tests/Template.py
+++ b/cheetah/Tests/Template.py
@@ -345,6 +345,16 @@ class MultipleInheritanceSupport(TemplateTest):
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 ##