summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_text.py
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2014-02-18 18:07:07 +0100
committerBaptiste Mispelon <bmispelon@gmail.com>2014-02-22 13:50:12 +0100
commit847171b0d09c7da95cd404bab80f84c890fc5cfd (patch)
treed847698fc3cdbd7f39a3a750433d22e7d09fb12b /tests/utils_tests/test_text.py
parentcd027aaadfeac84111306ecda11ef5a0cfaacb75 (diff)
Fixed test failures when running in a narrow Python build.
Diffstat (limited to 'tests/utils_tests/test_text.py')
-rw-r--r--tests/utils_tests/test_text.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py
index 4911cac908..12e441b81a 100644
--- a/tests/utils_tests/test_text.py
+++ b/tests/utils_tests/test_text.py
@@ -1,9 +1,13 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+from unittest import skipUnless
+
from django.test import SimpleTestCase
from django.utils import six, text
+IS_WIDE_BUILD = (len('\U0001F4A9') == 1)
+
class TestUtilsText(SimpleTestCase):
@@ -156,6 +160,7 @@ class TestUtilsText(SimpleTestCase):
self.assertEqual(text.javascript_quote(input, quote_double_quotes=True),
'&quot;Text&quot;')
+ @skipUnless(IS_WIDE_BUILD)
def test_javascript_quote_unicode(self):
input = "<script>alert('Hello \\xff.\n Wel𝕃come\there\r');</script>"
output = r"<script>alert(\'Hello \\xff.\n Wel𝕃come\there\r\');<\/script>"