summaryrefslogtreecommitdiff
path: root/tests/regressiontests/staticfiles_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/staticfiles_tests')
-rw-r--r--tests/regressiontests/staticfiles_tests/tests.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py
index 0c8e7db17d..90c8621d0b 100644
--- a/tests/regressiontests/staticfiles_tests/tests.py
+++ b/tests/regressiontests/staticfiles_tests/tests.py
@@ -15,14 +15,14 @@ from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from django.test import TestCase
from django.test.utils import override_settings
-from django.utils.encoding import smart_text
+from django.utils.encoding import force_text
from django.utils.functional import empty
-from django.utils._os import rmtree_errorhandler
+from django.utils._os import rmtree_errorhandler, upath
from django.utils import six
from django.contrib.staticfiles import finders, storage
-TEST_ROOT = os.path.dirname(__file__)
+TEST_ROOT = os.path.dirname(upath(__file__))
TEST_SETTINGS = {
'DEBUG': True,
'MEDIA_URL': '/media/',
@@ -77,7 +77,7 @@ class BaseStaticFilesTestCase(object):
os.unlink(self._backup_filepath)
def assertFileContains(self, filepath, text):
- self.assertIn(text, self._get_file(smart_text(filepath)),
+ self.assertIn(text, self._get_file(force_text(filepath)),
"'%s' not in '%s'" % (text, filepath))
def assertFileNotFound(self, filepath):
@@ -195,7 +195,7 @@ class TestFindStatic(CollectionTestCase, TestDefaults):
call_command('findstatic', filepath, all=False, verbosity=0, stdout=out)
out.seek(0)
lines = [l.strip() for l in out.readlines()]
- with codecs.open(smart_text(lines[1].strip()), "r", "utf-8") as f:
+ with codecs.open(force_text(lines[1].strip()), "r", "utf-8") as f:
return f.read()
def test_all_files(self):
@@ -207,8 +207,8 @@ class TestFindStatic(CollectionTestCase, TestDefaults):
out.seek(0)
lines = [l.strip() for l in out.readlines()]
self.assertEqual(len(lines), 3) # three because there is also the "Found <file> here" line
- self.assertIn('project', lines[1])
- self.assertIn('apps', lines[2])
+ self.assertIn('project', force_text(lines[1]))
+ self.assertIn('apps', force_text(lines[2]))
class TestCollection(CollectionTestCase, TestDefaults):