My app is using django-localeurl. My unit testing were ok in django 1.5.5 but since I moved to django 1.6.2, i have many errors because of status 301 in response.
It seems that this is caused by wrong urls which don't take into account the locale prefix. In other words, when calling reverse
in a unit test, the usual django reverse
is called rather than the localeurl reverse
.
I've checked that the patch_reverse
is called in the unittest. My call is at the top of my main urls.py. It seems ok.
But for any reason, the django reverse
is restored by something.
This problem seems to occur only during unit testing. The urls are correctly localized when running the app.
I think the problem correspond to the following issue in django-localeurl : https://bitbucket.org/carljm/django-localeurl/issue/22/test-problem
Does anybody know what can cause this problem (unit testing mechanism have changed in django 1.6, is it the reason?) and how to fix it?
Update
The problem doesn't occur if I force the following setting
TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'