1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Made override_settings also work with TransactionTestCase when acting as a class decorator.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16592 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ramiro Morales
2011-08-10 22:26:34 +00:00
parent 4fc3741ee8
commit 27eb8bbfd0
2 changed files with 15 additions and 3 deletions

View File

@@ -1,10 +1,22 @@
from __future__ import with_statement
import os
from django.conf import settings, global_settings
from django.test import TestCase, signals
from django.test import TransactionTestCase, TestCase, signals
from django.test.utils import override_settings
# @override_settings(TEST='override')
class FullyDecoratedTranTestCase(TransactionTestCase):
def test_override(self):
self.assertEqual(settings.TEST, 'override')
@override_settings(TEST='override2')
def test_method_override(self):
self.assertEqual(settings.TEST, 'override2')
FullyDecoratedTranTestCase = override_settings(TEST='override')(FullyDecoratedTranTestCase)
# @override_settings(TEST='override')
class FullyDecoratedTestCase(TestCase):