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
a1c6cd6a
Kaydet (Commit)
a1c6cd6a
authored
Haz 10, 2014
tarafından
Tim Schaffer
Kaydeden (comit)
Claude Paroz
Haz 10, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #22780 -- Checked that LOCALE_PATHS is really a tuple
üst
868ff4e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
__init__.py
django/conf/__init__.py
+1
-1
tests.py
tests/settings_tests/tests.py
+21
-0
No files found.
django/conf/__init__.py
Dosyayı görüntüle @
a1c6cd6a
...
...
@@ -98,7 +98,7 @@ class Settings(BaseSettings):
%
(
self
.
SETTINGS_MODULE
,
e
)
)
tuple_settings
=
(
"INSTALLED_APPS"
,
"TEMPLATE_DIRS"
)
tuple_settings
=
(
"INSTALLED_APPS"
,
"TEMPLATE_DIRS"
,
"LOCALE_PATHS"
)
self
.
_explicit_settings
=
set
()
for
setting
in
dir
(
mod
):
if
setting
.
isupper
():
...
...
tests/settings_tests/tests.py
Dosyayı görüntüle @
a1c6cd6a
...
...
@@ -436,3 +436,24 @@ class IsOverriddenTest(TestCase):
self
.
assertFalse
(
settings
.
is_overridden
(
'TEMPLATE_LOADERS'
))
with
override_settings
(
TEMPLATE_LOADERS
=
[]):
self
.
assertTrue
(
settings
.
is_overridden
(
'TEMPLATE_LOADERS'
))
class
TestTupleSettings
(
unittest
.
TestCase
):
"""
Make sure settings that should be tuples throw ImproperlyConfigured if they
are set to a string instead of a tuple.
"""
tuple_settings
=
(
"INSTALLED_APPS"
,
"TEMPLATE_DIRS"
,
"LOCALE_PATHS"
)
def
test_tuple_settings
(
self
):
settings_module
=
ModuleType
(
'fake_settings_module'
)
settings_module
.
SECRET_KEY
=
'foo'
for
setting
in
self
.
tuple_settings
:
setattr
(
settings_module
,
setting
,
(
'non_tuple_value'
))
sys
.
modules
[
'fake_settings_module'
]
=
settings_module
try
:
with
self
.
assertRaises
(
ImproperlyConfigured
):
s
=
Settings
(
'fake_settings_module'
)
finally
:
del
sys
.
modules
[
'fake_settings_module'
]
delattr
(
settings_module
,
setting
)
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