Opened 11 years ago
Closed 11 years ago
#20502 closed Bug (fixed)
AppResolutionOrderI18NTests fails if 'de' locale cached by previous test
Reported by: | Chris Wilson | Owned by: | Claude Paroz |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | bmispelon@…, timograham@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Dicsovered by Travis running all Django tests:
If the following tests are run in this order:
- defaultfilters.tests.DefaultFiltersTests.test_localized_filesizeformat
- i18n.tests.AppResolutionOrderI18NTests
then the second test will fail because the first has cached the 'de' translation before the second one changes INSTALLED_APPS to install the test app, which has its own translation.
Change History (9)
comment:1 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 11 years ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Accepted |
Thanks!
I hit this issue during the sprints but could I wasn't able to find the conflicting tests (bisect
wasn't helpful).
Now I can reproduce this consistently:
./runtests.py --settings=test_sqlite defaultfilters.tests.DefaultFiltersTests.test_localized_filesizeformat i18n.tests.AppResolutionOrderI18NTests
always fail while ./runtests.py --settings=test_sqlite i18n.tests.AppResolutionOrderI18NTests defaultfilters.tests.DefaultFiltersTests.test_localized_filesizeformat
passes.
comment:3 by , 11 years ago
I guess the solution would be to isolate that test in a class inheriting from the new tests.i18n.TransRealMixin
.
comment:4 by , 11 years ago
Component: | Uncategorized → Testing framework |
---|---|
Patch needs improvement: | set |
Type: | Uncategorized → Bug |
Oh, didn't saw at first there was a pull request.
comment:5 by , 11 years ago
@claudep, looks like the pull request solves the issue, but did you set "Patch needs improvement" because you want a different approach?
comment:6 by , 11 years ago
Owner: | changed from | to
---|
Yes, I will push a solution based on TransRealMixin
.
comment:7 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 by , 11 years ago
Cc: | added |
---|---|
Has patch: | unset |
Patch needs improvement: | unset |
Resolution: | fixed |
Status: | closed → new |
Looks like this also affects:
tests.forms_tests.tests.test_regressions.FormsRegressionsTestCase.test_regression_3600
tests.template_tests.tests.Templates.test_templates
(must run then entiretemplate_tests
package to avoid missing template failures)django.contrib.humanize.tests.HumanizeTests.test_i18n_intcomma
andtest_i18n_intword
Run any of these tests followed by i18n.tests.AppResolutionOrderI18NTests
to see the failure.
comment:9 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Pull request