Hello,
Can anyone confirm this situation or provide a solution to this problem?
Problem:
Long time test execution when using override_settings on class and test. The setting overrode on test is LANGUAGE_CODE.
Description:
I have a TestCase with override_settings decorator (overriding anything - custom settings or django internal settings). The TestCase has a test, which also uses override_settings to change the language. When I run the test, it takes few (5-7) minutes to execute, but finally finishes good.
It’s really annoying when I have about 25 minutes of tests which take about 40 minutes (because of 3 tests with this situation).
Example:
@override_settings(ANY_SETTING='overrided')
class MyTestCase(TestCase):
@override_settings(LANGUAGE_CODE='en')
def test_translation(self):
# perform test
Executing this test takes few minutes. Always.
I tested overriding different settings and for any other setting - it runs fast. The only problem I encounter is the situation in example: overriding any setting on class and LANGUAGE_CODE on test.
What I tried:
- use ‘with override_settings()’
- overriding different settings to check and ensure this specific example is