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
1122d297
Kaydet (Commit)
1122d297
authored
Haz 18, 2014
tarafından
Andrew Godwin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[1.7.x] Fix __latest__ to actually resolve to the latest migration
üst
cd82069b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
1 deletion
+58
-1
loader.py
django/db/migrations/loader.py
+1
-1
test_loader.py
tests/migrations/test_loader.py
+20
-0
0001_initial.py
tests/migrations/test_migrations_latest/0001_initial.py
+13
-0
__init__.py
tests/migrations/test_migrations_latest/__init__.py
+0
-0
0001_initial.py
...s/migrations/test_migrations_latest_basic/0001_initial.py
+11
-0
0002_second.py
tests/migrations/test_migrations_latest_basic/0002_second.py
+13
-0
__init__.py
tests/migrations/test_migrations_latest_basic/__init__.py
+0
-0
No files found.
django/db/migrations/loader.py
Dosyayı görüntüle @
1122d297
...
...
@@ -155,7 +155,7 @@ class MigrationLoader(object):
if
key
[
1
]
==
"__first__"
:
return
list
(
self
.
graph
.
root_nodes
(
key
[
0
]))[
0
]
else
:
return
list
(
self
.
graph
.
root_nodes
(
key
[
0
]))[
-
1
]
return
list
(
self
.
graph
.
leaf_nodes
(
key
[
0
]))[
0
]
except
IndexError
:
if
self
.
ignore_no_migrations
:
return
None
...
...
tests/migrations/test_loader.py
Dosyayı görüntüle @
1122d297
...
...
@@ -122,6 +122,26 @@ class LoaderTests(TestCase):
],
)
@modify_settings
(
INSTALLED_APPS
=
{
'append'
:
'basic'
})
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations_latest"
,
"basic"
:
"migrations.test_migrations_latest_basic"
,
})
def
test_latest
(
self
):
"""
Makes sure that __latest__ works correctly.
"""
# Load and test the plan
migration_loader
=
MigrationLoader
(
connection
)
self
.
assertEqual
(
migration_loader
.
graph
.
forwards_plan
((
"migrations"
,
"0001_initial"
)),
[
(
"basic"
,
"0001_initial"
),
(
"basic"
,
"0002_second"
),
(
"migrations"
,
"0001_initial"
),
],
)
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations"
})
def
test_name_match
(
self
):
"Tests prefix name matching"
...
...
tests/migrations/test_migrations_latest/0001_initial.py
0 → 100644
Dosyayı görüntüle @
1122d297
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
"basic"
,
"__latest__"
),
]
operations
=
[]
tests/migrations/test_migrations_latest/__init__.py
0 → 100644
Dosyayı görüntüle @
1122d297
tests/migrations/test_migrations_latest_basic/0001_initial.py
0 → 100644
Dosyayı görüntüle @
1122d297
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[]
operations
=
[]
tests/migrations/test_migrations_latest_basic/0002_second.py
0 → 100644
Dosyayı görüntüle @
1122d297
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
"basic"
,
"0001_initial"
),
]
operations
=
[]
tests/migrations/test_migrations_latest_basic/__init__.py
0 → 100644
Dosyayı görüntüle @
1122d297
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