summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-02-16 09:30:05 -0500
committerTim Graham <timograham@gmail.com>2015-02-18 07:36:02 -0500
commit5068a51d88a7084bd0349d150816fc6041caa224 (patch)
tree71b5dcf73b5ab2c1e28757f31f1e9e678f759b27
parent1153bccc1bc654a547a310d0614b989606d25950 (diff)
[1.8.x] Refs #24324 -- Skipped fixtures_regress tests that fail on Python 2 on a non-ASCII path.
Backport of b8d6cdbcc90ff8af781d13131b79ce88a9eff66d from master
-rw-r--r--tests/fixtures_regress/tests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py
index 63dbe9e72b..e533be3bb6 100644
--- a/tests/fixtures_regress/tests.py
+++ b/tests/fixtures_regress/tests.py
@@ -5,8 +5,10 @@ from __future__ import unicode_literals
import json
import os
import re
+import unittest
import warnings
+import django
from django.core import management, serializers
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import CommandError
@@ -34,6 +36,16 @@ from .models import (
_cur_dir = os.path.dirname(os.path.abspath(upath(__file__)))
+def is_ascii(s):
+ return all(ord(c) < 128 for c in s)
+
+
+skipIfNonASCIIPath = unittest.skipIf(
+ not is_ascii(django.__file__) and six.PY2,
+ 'Python 2 crashes when checking non-ASCII exception messages.'
+)
+
+
class TestFixtures(TestCase):
def animal_pre_save_check(self, signal, sender, instance, **kwargs):
@@ -198,6 +210,7 @@ class TestFixtures(TestCase):
verbosity=0,
)
+ @skipIfNonASCIIPath
@override_settings(SERIALIZATION_MODULES={'unkn': 'unexistent.path'})
def test_unimportable_serializer(self):
"""
@@ -514,6 +527,7 @@ class TestFixtures(TestCase):
verbosity=0,
)
+ @skipIfNonASCIIPath
@override_settings(FIXTURE_DIRS=[os.path.join(_cur_dir, 'fixtures')])
def test_fixture_dirs_with_default_fixture_path(self):
"""