Permalink
Browse files

Added some tests for #21725.

  • Loading branch information...
bmispelon committed Feb 18, 2014
1 parent 578bdb5 commit cd027aaadfeac84111306ecda11ef5a0cfaacb75
No changes.
Binary file not shown.
@@ -0,0 +1,20 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-09-15 19:15+0200\n"
+"PO-Revision-Date: 2010-05-12 12:41-0300\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "A nice emoji: 💩"
+msgstr "Un beau caractère emoji: 💩"
@@ -136,6 +136,17 @@ def test_escaping(self):
response = self.client.get('/jsi18n_admin/?language=de')
self.assertContains(response, '\\x04')
+ @modify_settings(INSTALLED_APPS={'append': ['view_tests.app5']})
+ def test_non_BMP_char(self):
+ """
+ Non-BMP characters should not break the javascript_catalog (#21725).
+ """
+ with self.settings(LANGUAGE_CODE='en-us'), override('fr'):
+ response = self.client.get('/jsi18n/app5/')
+ self.assertEqual(response.status_code, 200)
+ self.assertContains(response, 'emoji')
+ self.assertContains(response, '\\ud83d\\udca9')
+
class JsI18NTestsMultiPackage(TestCase):
urls = 'view_tests.urls'
View
@@ -36,6 +36,11 @@
'packages': ('django.contrib.admin', 'view_tests'),
}
+js_info_dict_app5 = {
+ 'domain': 'djangojs',
+ 'packages': ('view_tests.app5',),
+}
+
urlpatterns = patterns('',
(r'^$', views.index_page),
@@ -54,6 +59,7 @@
# i18n views
(r'^i18n/', include('django.conf.urls.i18n')),
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
+ (r'^jsi18n/app5/$', 'django.views.i18n.javascript_catalog', js_info_dict_app5),
(r'^jsi18n_english_translation/$', 'django.views.i18n.javascript_catalog', js_info_dict_english_translation),
(r'^jsi18n_multi_packages1/$', 'django.views.i18n.javascript_catalog', js_info_dict_multi_packages1),
(r'^jsi18n_multi_packages2/$', 'django.views.i18n.javascript_catalog', js_info_dict_multi_packages2),

0 comments on commit cd027aa

Please sign in to comment.