1. import os
    
  2. 
    
  3. from django.conf import settings
    
  4. from django.test import SimpleTestCase
    
  5. from django.utils.translation import activate, get_language
    
  6. 
    
  7. here = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    
  8. pdir = os.path.split(os.path.split(os.path.abspath(here))[0])[0]
    
  9. extended_locale_paths = settings.LOCALE_PATHS + [
    
  10.     os.path.join(pdir, "i18n", "other", "locale"),
    
  11. ]
    
  12. 
    
  13. 
    
  14. class MultipleLocaleActivationTestCase(SimpleTestCase):
    
  15.     """
    
  16.     Tests for template rendering when multiple locales are activated during the
    
  17.     lifetime of the same process.
    
  18.     """
    
  19. 
    
  20.     def setUp(self):
    
  21.         self._old_language = get_language()
    
  22. 
    
  23.     def tearDown(self):
    
  24.         activate(self._old_language)