Ticket #6644: ticket-6644-r8233.diff

File ticket-6644-r8233.diff, 1.3 KB (added by mcroydon, 16 years ago)

Updated patch to apply against r8233.

  • django/contrib/formtools/tests.py

    diff --git a/django/contrib/formtools/tests.py b/django/contrib/formtools/tests.py
    index 2ea0cc9..42d0355 100644
    a b  
     1import os
    12from django import forms
    23from django.contrib.formtools import preview
    34from django import http
    45from django.test import TestCase
     6from django.conf import settings
    57
    68success_string = "Done was called!"
    79test_data = {'field1': u'foo',
    class PreviewTests(TestCase):  
    2426
    2527    def setUp(self):
    2628        # 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,)
    2734        self.preview = preview.FormPreview(TestForm)
    2835        input_template = '<input type="hidden" name="%s" value="%s" />'
    2936        self.input = input_template % (self.preview.unused_name('stage'), "%d")
    3037
     38    def tearDown(self):
     39        settings.TEMPLATE_DIRS = self.OLD_TEMPLATE_DIRS
     40
    3141    def test_unused_name(self):
    3242        """
    3343        Verifies name mangling to get uniue field name.
Back to Top