MCPcopy
hub / github.com/django/django / test_override_exit

Method test_override_exit

tests/i18n/tests.py:211–229  ·  view source on GitHub ↗

The language restored is the one used when the function was called, not the one used when the decorator was initialized (#23381).

(self)

Source from the content-addressed store, hash-verified

209 deactivate()
210
211 def test_override_exit(self):
212 """
213 The language restored is the one used when the function was
214 called, not the one used when the decorator was initialized (#23381).
215 """
216 activate("fr")
217
218 @translation.override("pl")
219 def func_pl():
220 pass
221
222 deactivate()
223
224 try:
225 activate("en")
226 func_pl()
227 self.assertEqual(get_language(), "en")
228 finally:
229 deactivate()
230
231 def test_lazy_objects(self):
232 """

Callers

nothing calls this directly

Calls 3

activateFunction · 0.90
deactivateFunction · 0.90
get_languageFunction · 0.90

Tested by

no test coverage detected