From 9c2389901730c2ef01b8544eb80c3588383b0fb0 Mon Sep 17 00:00:00 2001 From: jeffrey k eliasen Date: Thu, 18 Oct 2018 17:05:12 -0700 Subject: [PATCH] template includes csrfToken property in javascript --- tests/test_templates.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_templates.py b/tests/test_templates.py index a296395f6..70c933d27 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -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)