template includes csrfToken property in javascript

This commit is contained in:
jeffrey k eliasen 2018-10-18 17:05:12 -07:00
parent cee6823ec0
commit 9c23899017

View File

@ -1,7 +1,11 @@
import re
from django.shortcuts import render
def test_base_template_with_no_context():
# base.html should be renderable with no context,
# 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)