Django

Code

Ticket #6644: ticket-6644-r8233.diff

File ticket-6644-r8233.diff, 1.3 kB (added by mcroydon, 5 months ago)

Updated patch to apply against r8233.

  • a/django/contrib/formtools/tests.py

    old new  
     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', 
     
    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.