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
61f56e23
Kaydet (Commit)
61f56e23
authored
Eyl 10, 2014
tarafından
Markus Bertheau
Kaydeden (comit)
Tim Graham
Eyl 10, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Corrected grammar in migrations error message.
üst
1ac32e76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
graph.py
django/db/migrations/graph.py
+2
-2
test_graph.py
tests/migrations/test_graph.py
+4
-2
No files found.
django/db/migrations/graph.py
Dosyayı görüntüle @
61f56e23
...
...
@@ -37,9 +37,9 @@ class MigrationGraph(object):
def
add_dependency
(
self
,
migration
,
child
,
parent
):
if
child
not
in
self
.
nodes
:
raise
KeyError
(
"Migration
%
s dependencies reference
s
nonexistent child node
%
r"
%
(
migration
,
child
))
raise
KeyError
(
"Migration
%
s dependencies reference nonexistent child node
%
r"
%
(
migration
,
child
))
if
parent
not
in
self
.
nodes
:
raise
KeyError
(
"Migration
%
s dependencies reference
s
nonexistent parent node
%
r"
%
(
migration
,
parent
))
raise
KeyError
(
"Migration
%
s dependencies reference nonexistent parent node
%
r"
%
(
migration
,
parent
))
self
.
dependencies
.
setdefault
(
child
,
set
())
.
add
(
parent
)
self
.
dependents
.
setdefault
(
parent
,
set
())
.
add
(
child
)
...
...
tests/migrations/test_graph.py
Dosyayı görüntüle @
61f56e23
...
...
@@ -174,7 +174,8 @@ class GraphTests(TestCase):
graph
.
add_node
((
"app_b"
,
"0001"
),
None
)
graph
.
add_dependency
(
"app_a.0003"
,
(
"app_a"
,
"0003"
),
(
"app_a"
,
"0002"
))
graph
.
add_dependency
(
"app_a.0002"
,
(
"app_a"
,
"0002"
),
(
"app_a"
,
"0001"
))
with
self
.
assertRaisesMessage
(
KeyError
,
"Migration app_a.0001 dependencies references nonexistent parent node ('app_b', '0002')"
):
msg
=
"Migration app_a.0001 dependencies reference nonexistent parent node ('app_b', '0002')"
with
self
.
assertRaisesMessage
(
KeyError
,
msg
):
graph
.
add_dependency
(
"app_a.0001"
,
(
"app_a"
,
"0001"
),
(
"app_b"
,
"0002"
))
def
test_missing_child_nodes
(
self
):
...
...
@@ -184,5 +185,6 @@ class GraphTests(TestCase):
# Build graph
graph
=
MigrationGraph
()
graph
.
add_node
((
"app_a"
,
"0001"
),
None
)
with
self
.
assertRaisesMessage
(
KeyError
,
"Migration app_a.0002 dependencies references nonexistent child node ('app_a', '0002')"
):
msg
=
"Migration app_a.0002 dependencies reference nonexistent child node ('app_a', '0002')"
with
self
.
assertRaisesMessage
(
KeyError
,
msg
):
graph
.
add_dependency
(
"app_a.0002"
,
(
"app_a"
,
"0002"
),
(
"app_a"
,
"0001"
))
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