mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
test_classes.py: Add activation to default language.
Running the backend tests with a high number of processes can cause unexpected errors with language changes. When certain tests that change the default language, (without explicitly overriding the teardown method to reset the default language), interleave with other tests that are expecting the language to be in English, discrepancies arise. This fixes a common nondeterministic test failure with high levels of parallelization.
This commit is contained in:
@@ -16,6 +16,7 @@ from django.db.migrations.executor import MigrationExecutor
|
||||
from django.db import connection
|
||||
from django.db.utils import IntegrityError
|
||||
from django.http import HttpRequest
|
||||
from django.utils import translation
|
||||
|
||||
from two_factor.models import PhoneDevice
|
||||
from zerver.lib.initial_password import initial_password
|
||||
@@ -100,6 +101,7 @@ class ZulipTestCase(TestCase):
|
||||
clear_client_event_queues_for_testing()
|
||||
clear_supported_auth_backends_cache()
|
||||
flush_per_request_caches()
|
||||
translation.activate(settings.LANGUAGE_CODE)
|
||||
|
||||
'''
|
||||
WRAPPER_COMMENT:
|
||||
|
||||
Reference in New Issue
Block a user