mirror of
https://github.com/django/django.git
synced 2025-08-27 14:04:41 +00:00
Fixed #22057 -- Ensured reverse_lazy can be used in settings
And without causing a circular import. Thanks Akis Kesoglou for the report.
This commit is contained in:
parent
faf6a911ad
commit
45edb9d235
3 changed files with 35 additions and 8 deletions
|
@ -40,7 +40,7 @@ custom_templates_dir = os.path.join(os.path.dirname(__file__), 'custom_templates
|
|||
|
||||
|
||||
class AdminScriptTestCase(unittest.TestCase):
|
||||
def write_settings(self, filename, apps=None, is_dir=False, sdict=None):
|
||||
def write_settings(self, filename, apps=None, is_dir=False, sdict=None, extra=None):
|
||||
if is_dir:
|
||||
settings_dir = os.path.join(test_dir, filename)
|
||||
os.mkdir(settings_dir)
|
||||
|
@ -51,6 +51,8 @@ class AdminScriptTestCase(unittest.TestCase):
|
|||
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)
|
||||
exports = [
|
||||
'DATABASES',
|
||||
'ROOT_URLCONF',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue