Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
49b67937
Kaydet (Commit)
49b67937
authored
Agu 18, 2018
tarafından
Hasan Ramezani
Kaydeden (comit)
Tim Graham
Agu 20, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29236 -- Fixed diffsettings crash if using settings.configure().
üst
cfb4845f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
5 deletions
+23
-5
AUTHORS
AUTHORS
+1
-0
diffsettings.py
django/core/management/commands/diffsettings.py
+2
-1
configured_settings_manage.py
tests/admin_scripts/configured_settings_manage.py
+9
-0
tests.py
tests/admin_scripts/tests.py
+11
-4
No files found.
AUTHORS
Dosyayı görüntüle @
49b67937
...
@@ -319,6 +319,7 @@ answer newbie questions, and generally made Django that much better:
...
@@ -319,6 +319,7 @@ answer newbie questions, and generally made Django that much better:
Gustavo Picon
Gustavo Picon
hambaloney
hambaloney
Hannes Struß <x@hannesstruss.de>
Hannes Struß <x@hannesstruss.de>
Hasan Ramezani <hasan.r67@gmail.com>
Hawkeye
Hawkeye
Helen Sherwood-Taylor <helen@rrdlabs.co.uk>
Helen Sherwood-Taylor <helen@rrdlabs.co.uk>
Henrique Romano <onaiort@gmail.com>
Henrique Romano <onaiort@gmail.com>
...
...
django/core/management/commands/diffsettings.py
Dosyayı görüntüle @
49b67937
...
@@ -42,7 +42,8 @@ class Command(BaseCommand):
...
@@ -42,7 +42,8 @@ class Command(BaseCommand):
from
django.conf
import
settings
,
Settings
,
global_settings
from
django.conf
import
settings
,
Settings
,
global_settings
# Because settings are imported lazily, we need to explicitly load them.
# Because settings are imported lazily, we need to explicitly load them.
settings
.
_setup
()
if
not
settings
.
configured
:
settings
.
_setup
()
user_settings
=
module_to_dict
(
settings
.
_wrapped
)
user_settings
=
module_to_dict
(
settings
.
_wrapped
)
default
=
options
[
'default'
]
default
=
options
[
'default'
]
...
...
tests/admin_scripts/configured_settings_manage.py
0 → 100644
Dosyayı görüntüle @
49b67937
#!/usr/bin/env python
import
sys
from
django.conf
import
settings
from
django.core.management
import
execute_from_command_line
if
__name__
==
'__main__'
:
settings
.
configure
(
DEBUG
=
True
)
execute_from_command_line
(
sys
.
argv
)
tests/admin_scripts/tests.py
Dosyayı görüntüle @
49b67937
...
@@ -159,16 +159,18 @@ class AdminScriptTestCase(unittest.TestCase):
...
@@ -159,16 +159,18 @@ class AdminScriptTestCase(unittest.TestCase):
script_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
django
.
__file__
),
'bin'
))
script_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
django
.
__file__
),
'bin'
))
return
self
.
run_test
(
os
.
path
.
join
(
script_dir
,
'django-admin.py'
),
args
,
settings_file
)
return
self
.
run_test
(
os
.
path
.
join
(
script_dir
,
'django-admin.py'
),
args
,
settings_file
)
def
run_manage
(
self
,
args
,
settings_file
=
None
):
def
run_manage
(
self
,
args
,
settings_file
=
None
,
configured_settings
=
False
):
def
safe_remove
(
path
):
def
safe_remove
(
path
):
try
:
try
:
os
.
remove
(
path
)
os
.
remove
(
path
)
except
OSError
:
except
OSError
:
pass
pass
conf_dir
=
os
.
path
.
dirname
(
conf
.
__file__
)
template_manage_py
=
(
template_manage_py
=
os
.
path
.
join
(
conf_dir
,
'project_template'
,
'manage.py-tpl'
)
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'configured_settings_manage.py'
)
if
configured_settings
else
os
.
path
.
join
(
os
.
path
.
dirname
(
conf
.
__file__
),
'project_template'
,
'manage.py-tpl'
)
)
test_manage_py
=
os
.
path
.
join
(
self
.
test_dir
,
'manage.py'
)
test_manage_py
=
os
.
path
.
join
(
self
.
test_dir
,
'manage.py'
)
shutil
.
copyfile
(
template_manage_py
,
test_manage_py
)
shutil
.
copyfile
(
template_manage_py
,
test_manage_py
)
...
@@ -2182,6 +2184,11 @@ class DiffSettings(AdminScriptTestCase):
...
@@ -2182,6 +2184,11 @@ class DiffSettings(AdminScriptTestCase):
self
.
assertNoOutput
(
err
)
self
.
assertNoOutput
(
err
)
self
.
assertOutput
(
out
,
"FOO = 'bar' ###"
)
self
.
assertOutput
(
out
,
"FOO = 'bar' ###"
)
def
test_settings_configured
(
self
):
out
,
err
=
self
.
run_manage
([
'diffsettings'
],
configured_settings
=
True
)
self
.
assertNoOutput
(
err
)
self
.
assertOutput
(
out
,
'DEBUG = True'
)
def
test_all
(
self
):
def
test_all
(
self
):
"""The all option also shows settings with the default value."""
"""The all option also shows settings with the default value."""
self
.
write_settings
(
'settings_to_diff.py'
,
sdict
=
{
'STATIC_URL'
:
'None'
})
self
.
write_settings
(
'settings_to_diff.py'
,
sdict
=
{
'STATIC_URL'
:
'None'
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment