summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2015-06-10 20:19:21 +0200
committerMarkus Holtermann <info@markusholtermann.eu>2015-06-11 16:38:12 +0200
commit5d428908218e3692d1bc7e4ada6235029ae9e45c (patch)
treec125198a5277e0145cdbbb27afe50cdb711bd648 /tests/admin_scripts
parent339c01fb7552feb8df125ef7e5420dae04fd913f (diff)
Fixed #24950 -- Added unicode_literals to models.py in app template
Thanks Tim Graham for the patch
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 7c07a51796..4b17690c1d 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -31,7 +31,7 @@ from django.test import (
from django.test.runner import DiscoverRunner
from django.utils._os import npath, upath
from django.utils.encoding import force_text
-from django.utils.six import StringIO
+from django.utils.six import PY3, StringIO
test_dir = os.path.realpath(os.path.join(tempfile.gettempdir(), 'test_project'))
if not os.path.exists(test_dir):
@@ -592,6 +592,13 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase):
self.addCleanup(shutil.rmtree, app_path)
self.assertNoOutput(err)
self.assertTrue(os.path.exists(app_path))
+ if not PY3:
+ with open(os.path.join(app_path, 'models.py'), 'r') as fp:
+ content = fp.read()
+ self.assertIn(
+ "from __future__ import unicode_literals\n",
+ content,
+ )
def test_setup_environ_custom_template(self):
"directory: startapp creates the correct directory with a custom template"