Make changing the active language inside `LiveTestServerCase` possible
|Reported by:||Alexey Boriskin||Owned by:||Greg Chapple|
|Cc:||Florian Apolloner||Triage Stage:||Accepted|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I was trying to make a selenium test to work with different locales in one test, like this:
for locale in locale_list: with translation.override(locale): self.selenium.get(something) ...test something...
But translation.override had affected only current thread, not LiveServerThread, probably because active translation is thread-local. Because I see no way to force LiveServerThread copy or share same thread-local state, it would be cool if I could have ability to stop LiveServerThread and recreate it in such cases. Currently it is started/stopped in setUpClass/tearDownClass which means that it is created once per TestCase run and shared between all the runs of all the test methods.
Change History (18)
comment:9 Changed 3 years ago by
|Summary:||Add ability to restart LiveServerThread inside a test method → Make changing the active language inside `LiveTestServerCase` possible|
comment:15 Changed 3 years ago by
|Owner:||Unai Zalakain deleted|
|Patch needs improvement:||unset|
|Status:||assigned → new|