MCPcopy
hub / github.com/django/django / test_app_translation

Method test_app_translation

tests/i18n/tests.py:1872–1891  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1870class AppResolutionOrderI18NTests(ResolutionOrderI18NTests):
1871 @override_settings(LANGUAGE_CODE="de")
1872 def test_app_translation(self):
1873 # Original translation.
1874 self.assertGettext("Date/time", "Datum/Zeit")
1875
1876 # Different translation.
1877 with self.modify_settings(INSTALLED_APPS={"append": "i18n.resolution"}):
1878 # Force refreshing translations.
1879 activate("de")
1880
1881 # Doesn't work because it's added later in the list.
1882 self.assertGettext("Date/time", "Datum/Zeit")
1883
1884 with self.modify_settings(
1885 INSTALLED_APPS={"remove": "django.contrib.admin.apps.SimpleAdminConfig"}
1886 ):
1887 # Force refreshing translations.
1888 activate("de")
1889
1890 # Unless the original is removed from the list.
1891 self.assertGettext("Date/time", "Datum/Zeit (APP)")
1892
1893
1894@override_settings(LOCALE_PATHS=extended_locale_paths)

Callers

nothing calls this directly

Calls 3

activateFunction · 0.90
assertGettextMethod · 0.80
modify_settingsMethod · 0.80

Tested by

no test coverage detected