summaryrefslogtreecommitdiff
path: root/tests/regressiontests/csrf_tests/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/csrf_tests/tests.py')
-rw-r--r--tests/regressiontests/csrf_tests/tests.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/regressiontests/csrf_tests/tests.py b/tests/regressiontests/csrf_tests/tests.py
index 2d9b4f755f..52fd3ea1c7 100644
--- a/tests/regressiontests/csrf_tests/tests.py
+++ b/tests/regressiontests/csrf_tests/tests.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
from django.conf import settings
from django.core.context_processors import csrf
@@ -11,7 +12,7 @@ from django.views.decorators.csrf import csrf_exempt, requires_csrf_token, ensur
# Response/views used for CsrfResponseMiddleware and CsrfViewMiddleware tests
def post_form_response():
- resp = HttpResponse(content=u"""
+ resp = HttpResponse(content="""
<html><body><h1>\u00a1Unicode!<form method="post"><input type="text" /></form></body></html>
""", mimetype="text/html")
return resp
@@ -215,18 +216,18 @@ class CsrfViewMiddlewareTest(TestCase):
"""
req = self._get_GET_no_csrf_cookie_request()
resp = token_view(req)
- self.assertEqual(u"", resp.content)
+ self.assertEqual("", resp.content)
def test_token_node_empty_csrf_cookie(self):
"""
Check that we get a new token if the csrf_cookie is the empty string
"""
req = self._get_GET_no_csrf_cookie_request()
- req.COOKIES[settings.CSRF_COOKIE_NAME] = ""
+ req.COOKIES[settings.CSRF_COOKIE_NAME] = b""
CsrfViewMiddleware().process_view(req, token_view, (), {})
resp = token_view(req)
- self.assertNotEqual(u"", resp.content)
+ self.assertNotEqual("", resp.content)
def test_token_node_with_csrf_cookie(self):
"""