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
d2ff8a72
Kaydet (Commit)
d2ff8a72
authored
Ara 09, 2014
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23975 -- Restored pre_migrate signal if all apps have migrations.
Thanks kmmbvnr for the report.
üst
f91d7366
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
migrate.py
django/core/management/commands/migrate.py
+1
-0
1.7.2.txt
docs/releases/1.7.2.txt
+3
-0
__init__.py
tests/migrate_signals/custom_migrations/__init__.py
+0
-0
tests.py
tests/migrate_signals/tests.py
+20
-1
No files found.
django/core/management/commands/migrate.py
Dosyayı görüntüle @
d2ff8a72
...
...
@@ -156,6 +156,7 @@ class Command(BaseCommand):
created_models
=
self
.
sync_apps
(
connection
,
executor
.
loader
.
unmigrated_apps
)
else
:
created_models
=
[]
emit_pre_migrate_signal
([],
self
.
verbosity
,
self
.
interactive
,
connection
.
alias
)
# The test runner requires us to flush after a syncdb but before migrations,
# so do that here.
...
...
docs/releases/1.7.2.txt
Dosyayı görüntüle @
d2ff8a72
...
...
@@ -146,3 +146,6 @@ Bugfixes
* Fixed migration crash when adding ``order_with_respect_to`` to a table
with existing rows (:ticket:`23983`).
* Restored the ``pre_migrate`` signal if all apps have migrations
(:ticket:`23975`).
tests/migrate_signals/custom_migrations/__init__.py
0 → 100644
Dosyayı görüntüle @
d2ff8a72
tests/migrate_signals/tests.py
Dosyayı görüntüle @
d2ff8a72
from
django.apps
import
apps
from
django.core
import
management
from
django.db.models
import
signals
from
django.test
import
TestCase
from
django.test
import
override_settings
,
TestCase
from
django.utils
import
six
...
...
@@ -75,3 +75,22 @@ class MigrateSignalTests(TestCase):
self
.
assertEqual
(
args
[
'verbosity'
],
MIGRATE_VERBOSITY
)
self
.
assertEqual
(
args
[
'interactive'
],
MIGRATE_INTERACTIVE
)
self
.
assertEqual
(
args
[
'using'
],
'default'
)
@override_settings
(
MIGRATION_MODULES
=
{
'migrate_signals'
:
'migrate_signals.custom_migrations'
})
def
test_pre_migrate_migrations_only
(
self
):
"""
If all apps have migrations, pre_migrate should be sent.
"""
r
=
PreMigrateReceiver
()
signals
.
pre_migrate
.
connect
(
r
,
sender
=
APP_CONFIG
)
stdout
=
six
.
StringIO
()
management
.
call_command
(
'migrate'
,
database
=
MIGRATE_DATABASE
,
verbosity
=
MIGRATE_VERBOSITY
,
interactive
=
MIGRATE_INTERACTIVE
,
load_initial_data
=
False
,
stdout
=
stdout
)
args
=
r
.
call_args
self
.
assertEqual
(
r
.
call_counter
,
1
)
self
.
assertEqual
(
set
(
args
),
set
(
PRE_MIGRATE_ARGS
))
self
.
assertEqual
(
args
[
'app_config'
],
APP_CONFIG
)
self
.
assertEqual
(
args
[
'verbosity'
],
MIGRATE_VERBOSITY
)
self
.
assertEqual
(
args
[
'interactive'
],
MIGRATE_INTERACTIVE
)
self
.
assertEqual
(
args
[
'using'
],
'default'
)
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