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
31f85bae
Kaydet (Commit)
31f85bae
authored
Kas 15, 2014
tarafından
wrwrwr
Kaydeden (comit)
Tim Graham
Kas 24, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Changed test_runner imports to name objects imported from test.runner.
üst
1dbdc033
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
tests.py
tests/test_runner/tests.py
+13
-12
No files found.
tests/test_runner/tests.py
Dosyayı görüntüle @
31f85bae
...
...
@@ -10,7 +10,8 @@ from django.conf import settings
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.management
import
call_command
from
django.db.backends.dummy.base
import
DatabaseCreation
from
django.test
import
runner
,
TestCase
,
TransactionTestCase
,
skipUnlessDBFeature
from
django.test
import
TestCase
,
TransactionTestCase
,
skipUnlessDBFeature
from
django.test.runner
import
DiscoverRunner
,
dependency_ordered
from
django.test.testcases
import
connections_support_transactions
from
django.utils
import
six
...
...
@@ -31,7 +32,7 @@ class DependencyOrderingTests(unittest.TestCase):
'bravo'
:
[
'charlie'
],
}
ordered
=
runner
.
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
ordered
=
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
ordered_sigs
=
[
sig
for
sig
,
value
in
ordered
]
self
.
assertIn
(
's1'
,
ordered_sigs
)
...
...
@@ -51,7 +52,7 @@ class DependencyOrderingTests(unittest.TestCase):
'bravo'
:
[
'charlie'
],
}
ordered
=
runner
.
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
ordered
=
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
ordered_sigs
=
[
sig
for
sig
,
value
in
ordered
]
self
.
assertIn
(
's1'
,
ordered_sigs
)
...
...
@@ -78,7 +79,7 @@ class DependencyOrderingTests(unittest.TestCase):
'delta'
:
[
'charlie'
],
}
ordered
=
runner
.
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
ordered
=
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
ordered_sigs
=
[
sig
for
sig
,
aliases
in
ordered
]
self
.
assertIn
(
's1'
,
ordered_sigs
)
...
...
@@ -105,7 +106,7 @@ class DependencyOrderingTests(unittest.TestCase):
'alpha'
:
[
'bravo'
],
}
self
.
assertRaises
(
ImproperlyConfigured
,
runner
.
dependency_ordered
,
raw
,
dependencies
=
dependencies
)
self
.
assertRaises
(
ImproperlyConfigured
,
dependency_ordered
,
raw
,
dependencies
=
dependencies
)
def
test_own_alias_dependency
(
self
):
raw
=
[
...
...
@@ -116,7 +117,7 @@ class DependencyOrderingTests(unittest.TestCase):
}
with
self
.
assertRaises
(
ImproperlyConfigured
):
runner
.
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
# reordering aliases shouldn't matter
raw
=
[
...
...
@@ -124,7 +125,7 @@ class DependencyOrderingTests(unittest.TestCase):
]
with
self
.
assertRaises
(
ImproperlyConfigured
):
runner
.
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
dependency_ordered
(
raw
,
dependencies
=
dependencies
)
class
MockTestRunner
(
object
):
...
...
@@ -151,7 +152,7 @@ class ManageCommandTests(unittest.TestCase):
testrunner
=
'test_runner.NonExistentRunner'
)
class
CustomOptionsTestRunner
(
runner
.
DiscoverRunner
):
class
CustomOptionsTestRunner
(
DiscoverRunner
):
def
__init__
(
self
,
verbosity
=
1
,
interactive
=
True
,
failfast
=
True
,
option_a
=
None
,
option_b
=
None
,
option_c
=
None
,
**
kwargs
):
super
(
CustomOptionsTestRunner
,
self
)
.
__init__
(
verbosity
=
verbosity
,
interactive
=
interactive
,
...
...
@@ -244,7 +245,7 @@ class Sqlite3InMemoryTestDbs(TestCase):
},
})
other
=
db
.
connections
[
'other'
]
runner
.
DiscoverRunner
(
verbosity
=
0
)
.
setup_databases
()
DiscoverRunner
(
verbosity
=
0
)
.
setup_databases
()
msg
=
"DATABASES setting '
%
s' option set to sqlite3's ':memory:' value shouldn't interfere with transaction support detection."
%
option_key
# Transaction support should be properly initialized for the 'other' DB
self
.
assertTrue
(
other
.
features
.
supports_transactions
,
msg
)
...
...
@@ -259,7 +260,7 @@ class DummyBackendTest(unittest.TestCase):
"""
Test that setup_databases() doesn't fail with dummy database backend.
"""
runner_instance
=
runner
.
DiscoverRunner
(
verbosity
=
0
)
runner_instance
=
DiscoverRunner
(
verbosity
=
0
)
old_db_connections
=
db
.
connections
try
:
db
.
connections
=
db
.
ConnectionHandler
({})
...
...
@@ -277,7 +278,7 @@ class AliasedDefaultTestSetupTest(unittest.TestCase):
"""
Test that setup_datebases() doesn't fail when 'default' is aliased
"""
runner_instance
=
runner
.
DiscoverRunner
(
verbosity
=
0
)
runner_instance
=
DiscoverRunner
(
verbosity
=
0
)
old_db_connections
=
db
.
connections
try
:
db
.
connections
=
db
.
ConnectionHandler
({
...
...
@@ -303,7 +304,7 @@ class SetupDatabasesTests(unittest.TestCase):
self
.
_old_db_connections
=
db
.
connections
self
.
_old_destroy_test_db
=
DatabaseCreation
.
destroy_test_db
self
.
_old_create_test_db
=
DatabaseCreation
.
create_test_db
self
.
runner_instance
=
runner
.
DiscoverRunner
(
verbosity
=
0
)
self
.
runner_instance
=
DiscoverRunner
(
verbosity
=
0
)
def
tearDown
(
self
):
DatabaseCreation
.
create_test_db
=
self
.
_old_create_test_db
...
...
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