Ticket #24622: backwards_incompatible_test.py

File backwards_incompatible_test.py, 575 bytes (added by Moritz Sichert, 9 years ago)
Line 
1from django.template.loader import get_template
2from django.test import TestCase
3from django.test.signals import template_rendered
4
5
6class TestTemplateInheritance(TestCase):
7 def test_inherit_template(self):
8 self.template_rendered = False
9 def signal_receiver(template, context, **kwargs):
10 if template.name == 'base.html':
11 self.template_rendered = True
12
13 template_rendered.connect(signal_receiver)
14
15 template = get_template('derived.html')
16 template.render()
17
18 self.assertTrue(self.template_rendered)
Back to Top