mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Used double quotation marks for csrf form element.
This commit is contained in:
committed by
Carlton Gibson
parent
9e86185936
commit
98019df855
@@ -64,7 +64,7 @@ class CsrfViewMiddlewareTestMixin:
|
||||
|
||||
def _check_token_present(self, response, csrf_id=None):
|
||||
text = str(response.content, response.charset)
|
||||
match = re.search("name='csrfmiddlewaretoken' value='(.*?)'", text)
|
||||
match = re.search('name="csrfmiddlewaretoken" value="(.*?)"', text)
|
||||
csrf_token = csrf_id or self._csrf_id
|
||||
self.assertTrue(
|
||||
match and equivalent_tokens(csrf_token, match.group(1)),
|
||||
|
||||
Reference in New Issue
Block a user