summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-01-19 18:45:50 +0100
committerClaude Paroz <claude@2xlibre.net>2016-01-23 14:00:55 +0100
commit104eddbdf6c31984b5afbdf5477267570de6d0f4 (patch)
tree465519c500b40e9a7e156218dc407d2d0fb9d919 /tests
parent7037dc57245c7ed0b9ef7e4a3cded963d0644b44 (diff)
Fixed #26093 -- Allowed escape sequences extraction by gettext on Python 3
Thanks Sylvain Fankhauser for the report and Tim Graham for the review.
Diffstat (limited to 'tests')
-rw-r--r--tests/i18n/commands/templates/test.html2
-rw-r--r--tests/i18n/test_extraction.py8
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/i18n/commands/templates/test.html b/tests/i18n/commands/templates/test.html
index dde42d3fdd..e7f7ba93eb 100644
--- a/tests/i18n/commands/templates/test.html
+++ b/tests/i18n/commands/templates/test.html
@@ -98,3 +98,5 @@ First `trans`, then `blocktrans` with a plural
{% plural %}
Plural for a `trans` and `blocktrans` collision case
{% endblocktrans %}
+
+{% trans "Non-breaking spaceĀ :" %}
diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py
index f72aa00771..dd28a76c4f 100644
--- a/tests/i18n/test_extraction.py
+++ b/tests/i18n/test_extraction.py
@@ -204,6 +204,14 @@ class BasicExtractorTests(ExtractorTests):
po_contents
)
+ def test_special_char_extracted(self):
+ os.chdir(self.test_dir)
+ management.call_command('makemessages', locale=[LOCALE], verbosity=0)
+ self.assertTrue(os.path.exists(self.PO_FILE))
+ with open(self.PO_FILE, 'r') as fp:
+ po_contents = force_text(fp.read())
+ self.assertMsgId("Non-breaking space\xa0:", po_contents)
+
def test_blocktrans_trimmed(self):
os.chdir(self.test_dir)
management.call_command('makemessages', locale=[LOCALE], verbosity=0)