mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-01 19:10:12 +03:00
template includes csrfToken property in javascript
This commit is contained in:
parent
cee6823ec0
commit
9c23899017
|
@ -1,7 +1,11 @@
|
||||||
|
import re
|
||||||
|
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
|
||||||
def test_base_template_with_no_context():
|
def test_base_template_with_no_context():
|
||||||
# base.html should be renderable with no context,
|
# base.html should be renderable with no context,
|
||||||
# so it can be easily extended.
|
# so it can be easily extended.
|
||||||
render({}, 'rest_framework/base.html')
|
result = render({}, 'rest_framework/base.html')
|
||||||
|
# note that this response will not include a valid CSRF token
|
||||||
|
assert re.search(r'\bcsrfToken: ""', result.content)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user