diff options
| author | Benjamin Wohlwend <piquadrat@gmail.com> | 2015-09-16 14:51:14 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-22 14:10:56 -0400 |
| commit | 2b9eed41fa26537d1af4f818c6e4296ce3305b01 (patch) | |
| tree | b412cdf1a35b489210d8a9c99f0fc1e8487e63d0 | |
| parent | 59e85f09c6c8171d5b24290d455e351063d81f5a (diff) | |
Refs #24622 -- Documented alternatives to some test response attributes when using alternative template engines.
| -rw-r--r-- | docs/topics/testing/tools.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index 0c97a67267..43255fa589 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -452,6 +452,14 @@ Specifically, a ``Response`` object has the following attributes: >>> response.context['name'] 'Arthur' + .. admonition:: Not using Django templates? + + This attribute is only populated when using the + :class:`~django.template.backends.django.DjangoTemplates` backend. + If you're using another template engine, + :attr:`~django.template.response.SimpleTemplateResponse.context_data` + may be a suitable alternative on responses with that attribute. + .. method:: json(**kwargs) .. versionadded:: 1.9 @@ -488,6 +496,15 @@ Specifically, a ``Response`` object has the following attributes: loaded from a file. (The name is a string such as ``'admin/index.html'``.) + .. admonition:: Not using Django templates? + + This attribute is only populated when using the + :class:`~django.template.backends.django.DjangoTemplates` backend. + If you're using another template engine, + :attr:`~django.template.response.SimpleTemplateResponse.template_name` + may be a suitable alternative if you only need the name of the + template used for rendering. + .. attribute:: resolver_match An instance of :class:`~django.core.urlresolvers.ResolverMatch` for the |
