summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/testing.txt16
1 files changed, 1 insertions, 15 deletions
diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
index 829e059181..39f07708ff 100644
--- a/docs/topics/testing.txt
+++ b/docs/topics/testing.txt
@@ -1450,14 +1450,13 @@ The decorator can also be applied to test case classes::
from django.test import TestCase
from django.test.utils import override_settings
+ @override_settings(LOGIN_URL='/other/login/')
class LoginTestCase(TestCase):
def test_login(self):
response = self.client.get('/sekrit/')
self.assertRedirects(response, '/other/login/?next=/sekrit/')
- LoginTestCase = override_settings(LOGIN_URL='/other/login/')(LoginTestCase)
-
.. note::
When given a class, the decorator modifies the class directly and
@@ -1467,19 +1466,6 @@ The decorator can also be applied to test case classes::
the original ``LoginTestCase`` is still equally affected by the
decorator.
-On Python 2.6 and higher you can also use the well known decorator syntax to
-decorate the class::
-
- from django.test import TestCase
- from django.test.utils import override_settings
-
- @override_settings(LOGIN_URL='/other/login/')
- class LoginTestCase(TestCase):
-
- def test_login(self):
- response = self.client.get('/sekrit/')
- self.assertRedirects(response, '/other/login/?next=/sekrit/')
-
.. note::
When overriding settings, make sure to handle the cases in which your app's