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
e6f19ec3
Kaydet (Commit)
e6f19ec3
authored
Kas 29, 2014
tarafından
wrwrwr
Kaydeden (comit)
Tim Graham
Ara 01, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23933 -- Made override_settings(DATABASE_ROUTERS) affect the master router.
üst
d2202ec2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
signals.py
django/test/signals.py
+8
-1
1.8.txt
docs/releases/1.8.txt
+3
-0
tests.py
tests/test_utils/tests.py
+9
-1
No files found.
django/test/signals.py
Dosyayı görüntüle @
e6f19ec3
...
...
@@ -4,7 +4,8 @@ import threading
import
warnings
from
django.conf
import
settings
from
django.db
import
connections
from
django.db
import
connections
,
router
from
django.db.utils
import
ConnectionRouter
from
django.dispatch
import
receiver
,
Signal
from
django.utils
import
timezone
from
django.utils.functional
import
empty
...
...
@@ -77,6 +78,12 @@ def update_connections_time_zone(**kwargs):
conn
.
cursor
()
.
execute
(
tz_sql
,
[
tz
])
@receiver
(
setting_changed
)
def
clear_routers_cache
(
**
kwargs
):
if
kwargs
[
'setting'
]
==
'DATABASE_ROUTERS'
:
router
.
routers
=
ConnectionRouter
()
.
routers
@receiver
(
setting_changed
)
def
reset_default_template_engine
(
**
kwargs
):
if
kwargs
[
'setting'
]
in
{
...
...
docs/releases/1.8.txt
Dosyayı görüntüle @
e6f19ec3
...
...
@@ -500,6 +500,9 @@ Tests
for Oracle: :setting:`DATAFILE`, :setting:`DATAFILE_TMP`,
:setting:`DATAFILE_MAXSIZE` and :setting:`DATAFILE_TMP_MAXSIZE`.
* The :func:`~django.test.override_settings` decorator can now affect the
master router in :setting:`DATABASE_ROUTERS`.
Validators
^^^^^^^^^^
...
...
tests/test_utils/tests.py
Dosyayı görüntüle @
e6f19ec3
...
...
@@ -6,7 +6,7 @@ import unittest
from
django.conf.urls
import
url
from
django.core.files.storage
import
default_storage
from
django.core.urlresolvers
import
NoReverseMatch
,
reverse
from
django.db
import
connection
from
django.db
import
connection
,
router
from
django.forms
import
EmailField
,
IntegerField
from
django.http
import
HttpResponse
from
django.template.loader
import
render_to_string
...
...
@@ -842,3 +842,11 @@ class OverrideSettingsTests(TestCase):
self
.
assertIsNone
(
default_storage
.
directory_permissions_mode
)
with
self
.
settings
(
FILE_UPLOAD_DIRECTORY_PERMISSIONS
=
0
o777
):
self
.
assertEqual
(
default_storage
.
directory_permissions_mode
,
0
o777
)
def
test_override_database_routers
(
self
):
"""
Overriding DATABASE_ROUTERS should update the master router.
"""
test_routers
=
(
object
(),)
with
self
.
settings
(
DATABASE_ROUTERS
=
test_routers
):
self
.
assertSequenceEqual
(
router
.
routers
,
test_routers
)
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