diff --git a/tests/test_templates.py b/tests/test_templates.py index 1142c4a45..19f511b96 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -3,6 +3,12 @@ import re from django.shortcuts import render +def test_base_template_with_context(): + context = {'request': True, 'csrf_token': 'TOKEN'} + result = render({}, 'rest_framework/base.html', context=context) + assert re.search(r'\bcsrfToken: "TOKEN"', result.content.decode('utf-8')) + + def test_base_template_with_no_context(): # base.html should be renderable with no context, # so it can be easily extended.