summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-08-10 22:26:34 +0000
committerRamiro Morales <cramm0@gmail.com>2011-08-10 22:26:34 +0000
commit27eb8bbfd09594e3f0f40391ca1a06b896acebdf (patch)
treef88848e1007fe109df4acad42c515f5d1362527f /tests
parent4fc3741ee88493a7884708fb4a9170da31637294 (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/settings_tests/tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/regressiontests/settings_tests/tests.py b/tests/regressiontests/settings_tests/tests.py
index 369ab30aa4..9715046bd4 100644
--- a/tests/regressiontests/settings_tests/tests.py
+++ b/tests/regressiontests/settings_tests/tests.py
@@ -1,11 +1,23 @@
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):
def test_override(self):