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
f6800a08
Kaydet (Commit)
f6800a08
authored
Haz 16, 2017
tarafından
Chandrakant Kumar
Kaydeden (comit)
Tim Graham
Haz 16, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #27787 -- Corrected or removed invalid call_command() options.
üst
874b1f2c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
19 deletions
+11
-19
testcases.py
django/test/testcases.py
+5
-9
tests.py
tests/cache/tests.py
+3
-7
tests.py
tests/fixtures/tests.py
+3
-3
No files found.
django/test/testcases.py
Dosyayı görüntüle @
f6800a08
...
@@ -988,15 +988,11 @@ class TestCase(TransactionTestCase):
...
@@ -988,15 +988,11 @@ class TestCase(TransactionTestCase):
if
cls
.
fixtures
:
if
cls
.
fixtures
:
for
db_name
in
cls
.
_databases_names
(
include_mirrors
=
False
):
for
db_name
in
cls
.
_databases_names
(
include_mirrors
=
False
):
try
:
try
:
call_command
(
'loaddata'
,
*
cls
.
fixtures
,
**
{
call_command
(
'loaddata'
,
*
cls
.
fixtures
,
**
{
'verbosity'
:
0
,
'database'
:
db_name
})
'verbosity'
:
0
,
except
Exception
:
'commit'
:
False
,
cls
.
_rollback_atomics
(
cls
.
cls_atomics
)
'database'
:
db_name
,
raise
})
except
Exception
:
cls
.
_rollback_atomics
(
cls
.
cls_atomics
)
raise
try
:
try
:
cls
.
setUpTestData
()
cls
.
setUpTestData
()
except
Exception
:
except
Exception
:
...
...
tests/cache/tests.py
Dosyayı görüntüle @
f6800a08
...
@@ -961,7 +961,7 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase):
...
@@ -961,7 +961,7 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase):
self
.
drop_table
()
self
.
drop_table
()
def
create_table
(
self
):
def
create_table
(
self
):
management
.
call_command
(
'createcachetable'
,
verbosity
=
0
,
interactive
=
False
)
management
.
call_command
(
'createcachetable'
,
verbosity
=
0
)
def
drop_table
(
self
):
def
drop_table
(
self
):
with
connection
.
cursor
()
as
cursor
:
with
connection
.
cursor
()
as
cursor
:
...
@@ -1042,9 +1042,7 @@ class CreateCacheTableForDBCacheTests(TestCase):
...
@@ -1042,9 +1042,7 @@ class CreateCacheTableForDBCacheTests(TestCase):
def
test_createcachetable_observes_database_router
(
self
):
def
test_createcachetable_observes_database_router
(
self
):
# cache table should not be created on 'default'
# cache table should not be created on 'default'
with
self
.
assertNumQueries
(
0
,
using
=
'default'
):
with
self
.
assertNumQueries
(
0
,
using
=
'default'
):
management
.
call_command
(
'createcachetable'
,
management
.
call_command
(
'createcachetable'
,
database
=
'default'
,
verbosity
=
0
)
database
=
'default'
,
verbosity
=
0
,
interactive
=
False
)
# cache table should be created on 'other'
# cache table should be created on 'other'
# Queries:
# Queries:
# 1: check table doesn't already exist
# 1: check table doesn't already exist
...
@@ -1054,9 +1052,7 @@ class CreateCacheTableForDBCacheTests(TestCase):
...
@@ -1054,9 +1052,7 @@ class CreateCacheTableForDBCacheTests(TestCase):
# 5: release savepoint (if transactional DDL is supported)
# 5: release savepoint (if transactional DDL is supported)
num
=
5
if
connections
[
'other'
]
.
features
.
can_rollback_ddl
else
3
num
=
5
if
connections
[
'other'
]
.
features
.
can_rollback_ddl
else
3
with
self
.
assertNumQueries
(
num
,
using
=
'other'
):
with
self
.
assertNumQueries
(
num
,
using
=
'other'
):
management
.
call_command
(
'createcachetable'
,
management
.
call_command
(
'createcachetable'
,
database
=
'other'
,
verbosity
=
0
)
database
=
'other'
,
verbosity
=
0
,
interactive
=
False
)
class
PicklingSideEffect
:
class
PicklingSideEffect
:
...
...
tests/fixtures/tests.py
Dosyayı görüntüle @
f6800a08
...
@@ -592,8 +592,8 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
...
@@ -592,8 +592,8 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
def
test_loading_using
(
self
):
def
test_loading_using
(
self
):
# Load db fixtures 1 and 2. These will load using the 'default' database identifier explicitly
# Load db fixtures 1 and 2. These will load using the 'default' database identifier explicitly
management
.
call_command
(
'loaddata'
,
'db_fixture_1'
,
verbosity
=
0
,
using
=
'default'
)
management
.
call_command
(
'loaddata'
,
'db_fixture_1'
,
verbosity
=
0
,
database
=
'default'
)
management
.
call_command
(
'loaddata'
,
'db_fixture_2'
,
verbosity
=
0
,
using
=
'default'
)
management
.
call_command
(
'loaddata'
,
'db_fixture_2'
,
verbosity
=
0
,
database
=
'default'
)
self
.
assertQuerysetEqual
(
Article
.
objects
.
all
(),
[
self
.
assertQuerysetEqual
(
Article
.
objects
.
all
(),
[
'<Article: Who needs more than one database?>'
,
'<Article: Who needs more than one database?>'
,
'<Article: Who needs to use compressed data?>'
,
'<Article: Who needs to use compressed data?>'
,
...
@@ -604,7 +604,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
...
@@ -604,7 +604,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
with
self
.
assertRaisesMessage
(
CommandError
,
"No fixture named 'db_fixture_3' found."
):
with
self
.
assertRaisesMessage
(
CommandError
,
"No fixture named 'db_fixture_3' found."
):
management
.
call_command
(
'loaddata'
,
'db_fixture_3'
,
verbosity
=
0
)
management
.
call_command
(
'loaddata'
,
'db_fixture_3'
,
verbosity
=
0
)
with
self
.
assertRaisesMessage
(
CommandError
,
"No fixture named 'db_fixture_3' found."
):
with
self
.
assertRaisesMessage
(
CommandError
,
"No fixture named 'db_fixture_3' found."
):
management
.
call_command
(
'loaddata'
,
'db_fixture_3'
,
verbosity
=
0
,
using
=
'default'
)
management
.
call_command
(
'loaddata'
,
'db_fixture_3'
,
verbosity
=
0
,
database
=
'default'
)
self
.
assertQuerysetEqual
(
Article
.
objects
.
all
(),
[])
self
.
assertQuerysetEqual
(
Article
.
objects
.
all
(),
[])
def
test_output_formats
(
self
):
def
test_output_formats
(
self
):
...
...
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