#15143: Add precisions about setting the language for the test client
---------------------------+------------------------------------------------
Reporter: claudep | Owner: nobody
Status: new | Milestone:
Component: Documentation | Version: 1.2
Keywords: | Stage: Unreviewed
Has_patch: 0 |
---------------------------+------------------------------------------------
I suggest to add a note in the documentation about how to set the language
for the test client.
Without the LocaleMiddleware, it's possible to set it with the
activate/deactivate functions from django.utils.translation.
When LocaleMiddleware is activated, another method has to be used,
otherwise the settings.LANGUAGE_CODE is always used. I've been able to set
the language by passing HTTP_ACCEPT_LANGUAGE='de' to the get/post method,
or by loading a cookie
(client.cookies.load({settings.LANGUAGE_COOKIE_NAME:'de'})).
--
Ticket URL: <http://code.djangoproject.com/ticket/15143>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.