Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refs #21230 -- removed direct settings manipulation from signed cooki…

…es tests
  • Loading branch information...
commit b9bfcd82f0995b3bdd97a1c2cffa1cdd47ebc3c4 1 parent d35d2f6
@whoshuu whoshuu authored timgraham committed
Showing with 2 additions and 9 deletions.
  1. +2 −9 tests/signed_cookies_tests/tests.py
View
11 tests/signed_cookies_tests/tests.py
@@ -2,10 +2,9 @@
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 @@ def test_max_age_argument(self):
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')
Please sign in to comment.
Something went wrong with that request. Please try again.