diff options
| author | Tim Graham <timograham@gmail.com> | 2015-12-10 09:13:05 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-12-12 09:34:01 -0500 |
| commit | 10427646b887586bf89dacb3b5208b3ad2d17308 (patch) | |
| tree | f01ec36e92fd0a9a778673ff28e1c3423e039abd /tests/admin_scripts/tests.py | |
| parent | b0ad5081d51afa0a7ca71e865180d02f37fa2cca (diff) | |
Fixed #25909 -- Added unicode_literals import to apps.py generated by startapp.
Diffstat (limited to 'tests/admin_scripts/tests.py')
| -rw-r--r-- | tests/admin_scripts/tests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 755fb0b1d4..ea7c8a25f0 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -610,17 +610,17 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase): self.addCleanup(shutil.rmtree, app_path) self.assertNoOutput(err) self.assertTrue(os.path.exists(app_path)) + unicode_literals_import = "from __future__ import unicode_literals\n" with open(os.path.join(app_path, 'apps.py'), 'r') as f: content = f.read() self.assertIn("class SettingsTestConfig(AppConfig)", content) self.assertIn("name = 'settings_test'", content) + if not PY3: + self.assertIn(unicode_literals_import, content) 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, - ) + self.assertIn(unicode_literals_import, content) def test_setup_environ_custom_template(self): "directory: startapp creates the correct directory with a custom template" |
