Ticket #6644: formtools.diff
File formtools.diff, 1.5 KB (added by , 16 years ago) |
---|
-
django/contrib/formtools/tests.py
1 import os 1 2 from django import newforms as forms 2 3 from django.contrib.formtools import preview 3 4 from django import http … … 25 26 26 27 def setUp(self): 27 28 # Create a FormPreview instance to share between tests 29 # in the test runner use templates/tests/ to provide base.html 30 test_dir = os.path.join(os.path.dirname(__file__), 'templates', 'tests') 31 self.OLD_TEMPLATE_DIRS = settings.TEMPLATE_DIRS 32 if test_dir not in settings.TEMPLATE_DIRS: 33 settings.TEMPLATE_DIRS = settings.TEMPLATE_DIRS + (test_dir,) 28 34 self.preview = preview.FormPreview(TestForm) 29 35 input_template = '<input type="hidden" name="%s" value="%s" />' 30 36 self.input = input_template % (self.preview.unused_name('stage'), "%d") 31 37 38 def tearDown(self): 39 settings.TEMPLATE_DIRS = self.OLD_TEMPLATE_DIRS 40 32 41 def test_unused_name(self): 33 42 """ 34 43 Verifies name mangling to get uniue field name. -
django/contrib/formtools/templates/tests/base.html
1 {% block content %} 2 {% endblock %}