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
a772ea81
Kaydet (Commit)
a772ea81
authored
11 years ago
tarafından
Markus Holtermann
Kaydeden (comit)
Tim Graham
11 years ago
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #21115 -- Fixed NameError in migrate --list command
üst
2c607977
master
stable/1.10.x
stable/1.11.x
stable/1.7.x
stable/1.8.x
stable/1.9.x
stable/2.0.x
stable/2.1.x
stable/2.2.x
2.2.1
2.2
2.2rc1
2.2b1
2.2a1
2.1.8
2.1.7
2.1.6
2.1.5
2.1.4
2.1.3
2.1.2
2.1.1
2.1
2.1rc1
2.1b1
2.1a1
2.0.13
2.0.12
2.0.11
2.0.10
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0
2.0rc1
2.0b1
2.0a1
1.11.20
1.11.19
1.11.18
1.11.17
1.11.16
1.11.15
1.11.14
1.11.13
1.11.12
1.11.11
1.11.10
1.11.9
1.11.8
1.11.7
1.11.6
1.11.5
1.11.4
1.11.3
1.11.2
1.11.1
1.11
1.11rc1
1.11b1
1.11a1
1.10.8
1.10.7
1.10.6
1.10.5
1.10.4
1.10.3
1.10.2
1.10.1
1.10
1.10rc1
1.10b1
1.10a1
1.9.13
1.9.12
1.9.11
1.9.10
1.9.9
1.9.8
1.9.7
1.9.6
1.9.5
1.9.4
1.9.3
1.9.2
1.9.1
1.9
1.9rc2
1.9rc1
1.9b1
1.9a1
1.8.19
1.8.18
1.8.17
1.8.16
1.8.15
1.8.14
1.8.13
1.8.12
1.8.11
1.8.10
1.8.9
1.8.8
1.8.7
1.8.6
1.8.5
1.8.4
1.8.3
1.8.2
1.8.1
1.8
1.8c1
1.8b2
1.8b1
1.8a1
1.7.11
1.7.10
1.7.9
1.7.8
1.7.7
1.7.6
1.7.5
1.7.4
1.7.3
1.7.2
1.7.1
1.7
1.7c3
1.7c2
1.7c1
1.7b4
1.7b3
1.7b2
1.7b1
1.7a2
1.7a1
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
migrate.py
django/core/management/commands/migrate.py
+1
-1
test_commands.py
tests/migrations/test_commands.py
+22
-0
No files found.
django/core/management/commands/migrate.py
Dosyayı görüntüle @
a772ea81
...
...
@@ -264,7 +264,7 @@ class Command(BaseCommand):
if
apps
:
invalid_apps
=
[]
for
app
in
apps
:
if
app
_label
not
in
loader
.
migrated_apps
:
if
app
not
in
loader
.
migrated_apps
:
invalid_apps
.
append
(
app
)
if
invalid_apps
:
raise
CommandError
(
"No migrations present for:
%
s"
%
(
", "
.
join
(
invalid_apps
)))
...
...
This diff is collapsed.
Click to expand it.
tests/migrations/test_commands.py
Dosyayı görüntüle @
a772ea81
...
...
@@ -48,6 +48,28 @@ class MigrateTests(MigrationTestBase):
self
.
assertTableNotExists
(
"migrations_tribble"
)
self
.
assertTableNotExists
(
"migrations_book"
)
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations"
})
def
test_migrate_list
(
self
):
"""
Tests --list output of migrate command
"""
stdout
=
six
.
StringIO
()
call_command
(
"migrate"
,
list
=
True
,
stdout
=
stdout
,
verbosity
=
0
)
self
.
assertIn
(
"migrations"
,
stdout
.
getvalue
()
.
lower
())
self
.
assertIn
(
"[ ] 0001_initial"
,
stdout
.
getvalue
()
.
lower
())
self
.
assertIn
(
"[ ] 0002_second"
,
stdout
.
getvalue
()
.
lower
())
call_command
(
"migrate"
,
"migrations"
,
"0001"
,
verbosity
=
0
)
stdout
=
six
.
StringIO
()
# Giving the explicit app_label tests for selective `show_migration_list` in the command
call_command
(
"migrate"
,
"migrations"
,
list
=
True
,
stdout
=
stdout
,
verbosity
=
0
)
self
.
assertIn
(
"migrations"
,
stdout
.
getvalue
()
.
lower
())
self
.
assertIn
(
"[x] 0001_initial"
,
stdout
.
getvalue
()
.
lower
())
self
.
assertIn
(
"[ ] 0002_second"
,
stdout
.
getvalue
()
.
lower
())
# Cleanup by unmigrating everything
call_command
(
"migrate"
,
"migrations"
,
"zero"
,
verbosity
=
0
)
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations"
})
def
test_sqlmigrate
(
self
):
"""
...
...
This diff is collapsed.
Click to expand it.
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