Ticket #29452: 29452-test.diff

File 29452-test.diff, 1.4 KB (added by Ramiro Morales, 6 years ago)

Test case

  • tests/i18n/commands/templates/test.html

    diff --git a/tests/i18n/commands/templates/test.html b/tests/i18n/commands/templates/test.html
    index cac034e..3868dc1 100644
    a b Plural for a `trans` and `blocktrans` collision case  
    105105{% endblocktrans %}
    106106
    107107{% trans "Non-breaking space :" %}
     108
     109{% trans "Nón-ÁSCÍÏ text" %}
  • tests/i18n/test_extraction.py

    diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py
    index d9ce3b4..a0d16b9 100644
    a b class ExtractorTests(POFileAssertionMixin, RunInTmpDirMixin, SimpleTestCase):  
    128128
    129129class BasicExtractorTests(ExtractorTests):
    130130
     131    POT_FILE = 'locale/django.pot'
     132
    131133    @override_settings(USE_I18N=False)
    132134    def test_use_i18n_false(self):
    133135        """
    class BasicExtractorTests(ExtractorTests):  
    394396            po_contents = fp.read()
    395397            self.assertMsgStr("Größe", po_contents)
    396398
     399    def test_pot_charset_header_is_utf8(self):
     400        self.assertFalse(os.path.exists(self.POT_FILE))
     401        management.call_command('makemessages', locale=[LOCALE], verbosity=0, keep_pot=True)
     402        self.assertTrue(os.path.exists(self.POT_FILE))
     403        with open(self.POT_FILE, 'r', encoding='utf-8') as fp:
     404            contents = fp.read()
     405            self.assertIn(r'; charset=UTF-8\n"', contents)
     406
    397407
    398408class JavascriptExtractorTests(ExtractorTests):
    399409
Back to Top