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
69071e7f
Kaydet (Commit)
69071e7f
authored
Agu 23, 2018
tarafından
Matthijs Kooijman
Kaydeden (comit)
Tim Graham
Agu 23, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added manage.py test --testrunner tests.
üst
108c04f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
tests.py
tests/test_runner/tests.py
+33
-2
No files found.
tests/test_runner/tests.py
Dosyayı görüntüle @
69071e7f
...
...
@@ -150,8 +150,11 @@ class ManageCommandTests(unittest.TestCase):
call_command
(
'test'
,
'sites'
,
testrunner
=
'test_runner.NonexistentRunner'
)
class
CustomTestRunnerOptionsTests
(
AdminScriptTestCase
):
class
CustomTestRunnerOptionsSettingsTests
(
AdminScriptTestCase
):
"""
Custom runners can add command line arguments. The runner is specified
through a settings file.
"""
def
setUp
(
self
):
settings
=
{
'TEST_RUNNER'
:
'
\'
test_runner.runner.CustomOptionsTestRunner
\'
'
,
...
...
@@ -187,6 +190,34 @@ class CustomTestRunnerOptionsTests(AdminScriptTestCase):
self
.
assertOutput
(
out
,
'bar:foo:31337'
)
class
CustomTestRunnerOptionsCmdlineTests
(
AdminScriptTestCase
):
"""
Custom runners can add command line arguments when the runner is specified
using --testrunner.
"""
def
setUp
(
self
):
self
.
write_settings
(
'settings.py'
)
def
tearDown
(
self
):
self
.
remove_settings
(
'settings.py'
)
def
test_testrunner_equals
(
self
):
args
=
[
'test'
,
'--testrunner=test_runner.runner.CustomOptionsTestRunner'
,
'--option_a=bar'
,
'--option_b=foo'
,
'--option_c=31337'
]
out
,
err
=
self
.
run_django_admin
(
args
,
'test_project.settings'
)
self
.
assertNoOutput
(
err
)
self
.
assertOutput
(
out
,
'bar:foo:31337'
)
def
test_no_testrunner
(
self
):
args
=
[
'test'
,
'--testrunner'
]
out
,
err
=
self
.
run_django_admin
(
args
,
'test_project.settings'
)
self
.
assertIn
(
'usage'
,
err
)
self
.
assertNotIn
(
'Traceback'
,
err
)
self
.
assertNoOutput
(
out
)
class
Ticket17477RegressionTests
(
AdminScriptTestCase
):
def
setUp
(
self
):
self
.
write_settings
(
'settings.py'
)
...
...
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