Using Django 1.3, Python 2.6
Having a particularly weird problem to track down related to internationalization, and RequestFactory vs. TestClient for testing views
There are 2 possibilities :
a) You have 'django.middleware.locale.LocaleMiddleware'
in settings.MIDDLEWARE_CLASSES.
In this case, the client use settings.LANGUAGE_CODE
.
b) You don't.
In that case, you should set the language like that somewhere in your tests.py module:
from django.utils.translation import activate
...
activate('fr-fr')
https://code.djangoproject.com/ticket/15143