mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
Refs #24622 -- Documented alternatives to some test response attributes when using alternative template engines.
This commit is contained in:
parent
59e85f09c6
commit
2b9eed41fa
@ -452,6 +452,14 @@ Specifically, a ``Response`` object has the following attributes:
|
|||||||
>>> response.context['name']
|
>>> response.context['name']
|
||||||
'Arthur'
|
'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)
|
.. method:: json(**kwargs)
|
||||||
|
|
||||||
.. versionadded:: 1.9
|
.. 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
|
loaded from a file. (The name is a string such as
|
||||||
``'admin/index.html'``.)
|
``'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
|
.. attribute:: resolver_match
|
||||||
|
|
||||||
An instance of :class:`~django.core.urlresolvers.ResolverMatch` for the
|
An instance of :class:`~django.core.urlresolvers.ResolverMatch` for the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user