summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-12-01 11:38:01 +0100
committerClaude Paroz <claude@2xlibre.net>2017-01-18 16:21:28 +0100
commitc716fe87821df00f9f03ecc761c914d1682591a2 (patch)
tree0436706cdb190acbc76fb5fcf6d66f16e09fafa3 /tests/admin_scripts
parente63d98b7beb16d1410168a2315cbe04c43c9c80d (diff)
Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 08fe645535..e37e8a4256 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -27,7 +27,7 @@ from django.test import (
)
from django.utils._os import npath, upath
from django.utils.encoding import force_text
-from django.utils.six import PY2, StringIO
+from django.utils.six import StringIO
custom_templates_dir = os.path.join(os.path.dirname(upath(__file__)), 'custom_templates')
@@ -626,7 +626,6 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase):
self.assertTrue(os.path.exists(app_path))
self.assertTrue(os.path.exists(os.path.join(app_path, 'api.py')))
- @unittest.skipIf(PY2, "Python 2 doesn't support Unicode package names.")
def test_startapp_unicode_name(self):
"directory: startapp creates the correct directory with unicode characters"
args = ['startapp', 'こんにちは']
@@ -1897,18 +1896,11 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
self.addCleanup(shutil.rmtree, testproject_dir, True)
out, err = self.run_django_admin(args)
- if PY2:
- self.assertOutput(
- err,
- "Error: '%s' is not a valid project name. Please make "
- "sure the name begins with a letter or underscore." % bad_name
- )
- else:
- self.assertOutput(
- err,
- "Error: '%s' is not a valid project name. Please make "
- "sure the name is a valid identifier." % bad_name
- )
+ self.assertOutput(
+ err,
+ "Error: '%s' is not a valid project name. Please make "
+ "sure the name is a valid identifier." % bad_name
+ )
self.assertFalse(os.path.exists(testproject_dir))
def test_simple_project_different_directory(self):