mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #23919 -- Removed encoding preambles and future imports
This commit is contained in:
parent
397b3705c5
commit
d7b9aaa366
831 changed files with 6 additions and 2066 deletions
|
@ -1,5 +1,3 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core import checks
|
||||
from django.db import models
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core import checks
|
||||
from django.db import models
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
A series of tests to establish that the command-line management tools work as
|
||||
advertised - especially with regards to the handling of the
|
||||
DJANGO_SETTINGS_MODULE and default settings.py files.
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import codecs
|
||||
import os
|
||||
import re
|
||||
|
@ -30,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, PY3, StringIO
|
||||
from django.utils.six import PY2, StringIO
|
||||
|
||||
custom_templates_dir = os.path.join(os.path.dirname(upath(__file__)), 'custom_templates')
|
||||
|
||||
|
@ -67,7 +64,6 @@ class AdminScriptTestCase(unittest.TestCase):
|
|||
settings_file_path = os.path.join(self.test_dir, filename)
|
||||
|
||||
with open(settings_file_path, 'w') as settings_file:
|
||||
settings_file.write('# -*- coding: utf-8 -*\n')
|
||||
settings_file.write('# Settings file automatically generated by admin_scripts test case\n')
|
||||
if extra:
|
||||
settings_file.write("%s\n" % extra)
|
||||
|
@ -614,26 +610,10 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase):
|
|||
self.addCleanup(shutil.rmtree, app_path)
|
||||
self.assertNoOutput(err)
|
||||
self.assertTrue(os.path.exists(app_path))
|
||||
unicode_literals_import = "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\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(unicode_literals_import, content)
|
||||
with open(os.path.join(app_path, 'views.py'), 'r') as fp:
|
||||
content = fp.read()
|
||||
self.assertIn(unicode_literals_import, content)
|
||||
with open(os.path.join(app_path, 'admin.py'), 'r') as fp:
|
||||
content = fp.read()
|
||||
self.assertIn(unicode_literals_import, content)
|
||||
with open(os.path.join(app_path, 'tests.py'), 'r') as fp:
|
||||
content = fp.read()
|
||||
self.assertIn(unicode_literals_import, content)
|
||||
|
||||
def test_setup_environ_custom_template(self):
|
||||
"directory: startapp creates the correct directory with a custom template"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue