summaryrefslogtreecommitdiff
path: root/tests/signed_cookies_tests/tests.py
diff options
context:
space:
mode:
authorHuu Nguyen <huu@prismskylabs.com>2014-04-08 08:21:20 -0700
committerTim Graham <timograham@gmail.com>2014-04-08 12:15:08 -0400
commitb9bfcd82f0995b3bdd97a1c2cffa1cdd47ebc3c4 (patch)
treeef1108157fdfd03e28016bae994bdf09648133eb /tests/signed_cookies_tests/tests.py
parentd35d2f61c595fc9e6a03cfcbc21a4d5f937e3633 (diff)
Refs #21230 -- removed direct settings manipulation from signed cookies tests
Diffstat (limited to 'tests/signed_cookies_tests/tests.py')
-rw-r--r--tests/signed_cookies_tests/tests.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/signed_cookies_tests/tests.py b/tests/signed_cookies_tests/tests.py
index 67f5a2665f..2601d24219 100644
--- a/tests/signed_cookies_tests/tests.py
+++ b/tests/signed_cookies_tests/tests.py
@@ -2,10 +2,9 @@ from __future__ import unicode_literals
import time
-from django.conf import settings
from django.core import signing
from django.http import HttpRequest, HttpResponse
-from django.test import TestCase
+from django.test import TestCase, override_settings
class SignedCookieTest(TestCase):
@@ -64,14 +63,8 @@ class SignedCookieTest(TestCase):
finally:
time.time = _time
+ @override_settings(SECRET_KEY=b'\xe7')
def test_signed_cookies_with_binary_key(self):
- def restore_secret_key(prev):
- settings.SECRET_KEY = prev
-
- self.addCleanup(restore_secret_key, settings.SECRET_KEY)
-
- settings.SECRET_KEY = b'\xe7'
-
response = HttpResponse()
response.set_signed_cookie('c', 'hello')