summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-03-08 20:58:19 +0100
committerClaude Paroz <claude@2xlibre.net>2014-03-08 20:58:24 +0100
commit8d7e048a8b428bebe82be735a84570f9250441e6 (patch)
tree15de21082ddc25a9518c864229cfab382fc7e6a6 /tests/admin_scripts
parentb787ef2dbff957c5b5a64be13f01f985d17ff05b (diff)
Improved compatibility in admin_scripts tests
Environment keys/values need to use native strings on some plateforms. Thanks anubhav joshi for detecting the issue and helping shaping the patch.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index f59c337114..6ebac74fc3 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -24,7 +24,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.core.management import BaseCommand, CommandError, call_command
from django.db import connection
from django.utils.encoding import force_text
-from django.utils._os import upath
+from django.utils._os import npath, upath
from django.utils.six import StringIO
from django.test import LiveServerTestCase, TestCase
from django.test.runner import DiscoverRunner
@@ -138,8 +138,9 @@ class AdminScriptTestCase(unittest.TestCase):
del test_environ['DJANGO_SETTINGS_MODULE']
python_path = [base_dir, django_dir, tests_dir]
python_path.extend(ext_backend_base_dirs)
- test_environ[python_path_var_name] = os.pathsep.join(python_path)
- test_environ['PYTHONWARNINGS'] = ''
+ # Use native strings for better compatibility
+ test_environ[str(python_path_var_name)] = npath(os.pathsep.join(python_path))
+ test_environ[str('PYTHONWARNINGS')] = str('')
# Move to the test directory and run
os.chdir(test_dir)