Ticket #6644: ticket-6644-r8233.diff
| File ticket-6644-r8233.diff, 1.3 kB (added by mcroydon, 5 months ago) |
|---|
-
a/django/contrib/formtools/tests.py
old new 1 import os 1 2 from django import forms 2 3 from django.contrib.formtools import preview 3 4 from django import http 4 5 from django.test import TestCase 6 from django.conf import settings 5 7 6 8 success_string = "Done was called!" 7 9 test_data = {'field1': u'foo', … … 24 26 25 27 def setUp(self): 26 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,) 27 34 self.preview = preview.FormPreview(TestForm) 28 35 input_template = '<input type="hidden" name="%s" value="%s" />' 29 36 self.input = input_template % (self.preview.unused_name('stage'), "%d") 30 37 38 def tearDown(self): 39 settings.TEMPLATE_DIRS = self.OLD_TEMPLATE_DIRS 40 31 41 def test_unused_name(self): 32 42 """ 33 43 Verifies name mangling to get uniue field name.
