MCPcopy
hub / github.com/django/django / test_maclines

Method test_maclines

tests/i18n/tests.py:435–445  ·  view source on GitHub ↗

Translations on files with Mac or DOS end of lines will be converted to unix EOF in .po catalogs.

(self)

Source from the content-addressed store, hash-verified

433 self.assertEqual("as", mark_safe("a") + mark_safe("s"))
434
435 def test_maclines(self):
436 """
437 Translations on files with Mac or DOS end of lines will be converted
438 to unix EOF in .po catalogs.
439 """
440 ca_translation = trans_real.translation("ca")
441 ca_translation._catalog["Mac\nEOF\n"] = "Catalan Mac\nEOF\n"
442 ca_translation._catalog["Win\nEOF\n"] = "Catalan Win\nEOF\n"
443 with translation.override("ca", deactivate=True):
444 self.assertEqual("Catalan Mac\nEOF\n", gettext("Mac\rEOF\r"))
445 self.assertEqual("Catalan Win\nEOF\n", gettext("Win\r\nEOF\r\n"))
446
447 def test_to_locale(self):
448 tests = (

Callers

nothing calls this directly

Calls 1

gettextFunction · 0.90

Tested by

no test coverage detected