Tuesday, July 31, 2012

Weird test-behaviour in combination with localization

Hey together,
I was just writing some tests for my views and i stumbled upon a localization error, which i cant figure out :/
I have a test that checks the form-validation returnes the correct errors-messages for specific input data. Basicly what i feed to the view are the field-names and their values and in return i get a json-string with the error-messages for the fields.
This works fine, if i just run the tests for that specific view. (Result is something like {'fielda':'Dieses Feld ist zwingend erforderlich.'}, where 'Dieses Feld ist zwingend erforderlich.'=>'This field is required' in german). 
Now, if i run all tests, not just for that specific view, the test fails, because the view returnes {'fielda':'This field is required.'} instead of the german localization. I checked the settings.LANGUAGE_CODE-value in the view and in the test, in both cases it is de-de.
Any ideas, why my test is fine if it runs alone and fails when all tests of the project (including the django-ones) are run? Im fresh out of ideas and a little bit puzzled :D

Greetings & Thanks,
Andre

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/WrS3xL3_SBUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment