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
44304cf0
Kaydet (Commit)
44304cf0
authored
May 20, 2014
tarafından
Huu Nguyen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #22661 -- Move makemigrations tests to the proper class
üst
ba5ddf7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
test_commands.py
tests/migrations/test_commands.py
+22
-22
No files found.
tests/migrations/test_commands.py
Dosyayı görüntüle @
44304cf0
...
...
@@ -85,28 +85,6 @@ class MigrateTests(MigrationTestBase):
with
self
.
assertRaises
(
CommandError
):
call_command
(
"migrate"
,
"migrations"
)
@override_system_checks
([])
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations_conflict"
})
def
test_makemigrations_conflict_exit
(
self
):
"""
Makes sure that makemigrations exits if it detects a conflict.
"""
with
self
.
assertRaises
(
CommandError
):
call_command
(
"makemigrations"
)
@override_system_checks
([])
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations_conflict"
})
def
test_makemigrations_merge_basic
(
self
):
"""
Makes sure that makemigrations doesn't error if you ask for
merge mode with a conflict present. Doesn't test writing of the merge
file, as that requires temp directories.
"""
try
:
call_command
(
"makemigrations"
,
merge
=
True
,
verbosity
=
0
)
except
CommandError
:
self
.
fail
(
"Makemigrations errored in merge mode with conflicts"
)
@override_system_checks
([])
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations"
})
def
test_sqlmigrate
(
self
):
...
...
@@ -211,3 +189,25 @@ class MakeMigrationsTests(MigrationTestBase):
initial_file
=
os
.
path
.
join
(
self
.
migration_dir
,
"0001_initial.py"
)
self
.
assertFalse
(
os
.
path
.
exists
(
initial_file
))
@override_system_checks
([])
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations_conflict"
})
def
test_makemigrations_conflict_exit
(
self
):
"""
Makes sure that makemigrations exits if it detects a conflict.
"""
with
self
.
assertRaises
(
CommandError
):
call_command
(
"makemigrations"
)
@override_system_checks
([])
@override_settings
(
MIGRATION_MODULES
=
{
"migrations"
:
"migrations.test_migrations_conflict"
})
def
test_makemigrations_merge_basic
(
self
):
"""
Makes sure that makemigrations doesn't error if you ask for
merge mode with a conflict present. Doesn't test writing of the merge
file, as that requires temp directories.
"""
try
:
call_command
(
"makemigrations"
,
merge
=
True
,
verbosity
=
0
)
except
CommandError
:
self
.
fail
(
"Makemigrations errored in merge mode with conflicts"
)
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