MCPcopy
hub / github.com/django/django / test_pgettext

Method test_pgettext

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

Source from the content-addressed store, hash-verified

396
397 @override_settings(LOCALE_PATHS=extended_locale_paths)
398 def test_pgettext(self):
399 trans_real._active = Local()
400 trans_real._translations = {}
401 with translation.override("de"):
402 self.assertEqual(pgettext("unexisting", "May"), "May")
403 self.assertEqual(pgettext("month name", "May"), "Mai")
404 self.assertEqual(pgettext("verb", "May"), "Kann")
405 self.assertEqual(
406 npgettext("search", "%d result", "%d results", 4) % 4, "4 Resultate"
407 )
408
409 def test_empty_value(self):
410 """Empty value must stay empty after being translated (#23196)."""

Callers

nothing calls this directly

Calls 2

pgettextFunction · 0.90
npgettextFunction · 0.90

Tested by

no test coverage detected