diff --git a/tests/browsable_api/multiple_template_engines.py b/tests/browsable_api/multiple_template_engines.py new file mode 100644 index 000000000..59072aaf8 --- /dev/null +++ b/tests/browsable_api/multiple_template_engines.py @@ -0,0 +1,16 @@ +TEMPLATES = [ + { + "BACKEND": "django_jinja.backend.Jinja2", + "APP_DIRS": True, + "OPTIONS": { + "match_extension": ".html", + } + }, + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + 'OPTIONS': { + "debug": True, # We want template errors to raise + } + }, +] diff --git a/tests/browsable_api/test_browsable_api.py b/tests/browsable_api/test_browsable_api.py index 17644c2ac..0ec57625a 100644 --- a/tests/browsable_api/test_browsable_api.py +++ b/tests/browsable_api/test_browsable_api.py @@ -1,8 +1,11 @@ from django.contrib.auth.models import User -from django.test import TestCase, override_settings +from django.test import Client, TestCase, override_settings +from jinja2.exceptions import TemplateSyntaxError from rest_framework.test import APIClient +from .multiple_template_engines import TEMPLATES + @override_settings(ROOT_URLCONF='tests.browsable_api.auth_urls') class DropdownWithAuthTests(TestCase): @@ -72,3 +75,29 @@ class NoDropdownWithoutAuthTests(TestCase): response = self.client.get('/') content = response.content.decode() assert '