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
46789e76
Kaydet (Commit)
46789e76
authored
Haz 14, 2013
tarafından
Marc Tamlyn
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #20548 -- Removed all PendingDeprecationWarnings from django test suite
üst
5459795e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
16 deletions
+29
-16
tests.py
tests/forms_tests/tests/tests.py
+4
-2
tests.py
tests/model_forms/tests.py
+4
-1
tests.py
tests/model_forms_regress/tests.py
+3
-1
runtests.py
tests/runtests.py
+4
-1
tests.py
tests/test_runner/tests.py
+8
-6
tests.py
tests/test_suite_override/tests.py
+3
-2
tests.py
tests/test_utils/tests.py
+3
-3
No files found.
tests/forms_tests/tests/tests.py
Dosyayı görüntüle @
46789e76
...
...
@@ -208,7 +208,8 @@ class RelatedModelFormTests(TestCase):
ref
=
models
.
ForeignKey
(
"B"
)
class
Meta
:
model
=
A
model
=
A
fields
=
'__all__'
self
.
assertRaises
(
ValueError
,
ModelFormMetaclass
,
str
(
'Form'
),
(
ModelForm
,),
{
'Meta'
:
Meta
})
...
...
@@ -226,7 +227,8 @@ class RelatedModelFormTests(TestCase):
pass
class
Meta
:
model
=
A
model
=
A
fields
=
'__all__'
self
.
assertTrue
(
issubclass
(
ModelFormMetaclass
(
str
(
'Form'
),
(
ModelForm
,),
{
'Meta'
:
Meta
}),
ModelForm
))
...
...
tests/model_forms/tests.py
Dosyayı görüntüle @
46789e76
...
...
@@ -52,12 +52,15 @@ class PriceForm(forms.ModelForm):
class
BookForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Book
model
=
Book
fields
=
'__all__'
class
DerivedBookForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
DerivedBook
fields
=
'__all__'
class
ExplicitPKForm
(
forms
.
ModelForm
):
...
...
tests/model_forms_regress/tests.py
Dosyayı görüntüle @
46789e76
...
...
@@ -97,12 +97,14 @@ class PartiallyLocalizedTripleForm(forms.ModelForm):
class
Meta
:
model
=
Triple
localized_fields
=
(
'left'
,
'right'
,)
fields
=
'__all__'
class
FullyLocalizedTripleForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Triple
localized_fields
=
"__all__"
localized_fields
=
'__all__'
fields
=
'__all__'
class
LocalizedModelFormTest
(
TestCase
):
def
test_model_form_applies_localize_to_some_fields
(
self
):
...
...
tests/runtests.py
Dosyayı görüntüle @
46789e76
...
...
@@ -5,6 +5,7 @@ import shutil
import
subprocess
import
sys
import
tempfile
import
warnings
from
django
import
contrib
from
django.utils._os
import
upath
...
...
@@ -107,7 +108,9 @@ def setup(verbosity, test_labels):
logger
.
addHandler
(
handler
)
# Load all the ALWAYS_INSTALLED_APPS.
get_apps
()
with
warnings
.
catch_warnings
():
warnings
.
filterwarnings
(
'ignore'
,
'django.contrib.comments is deprecated and will be removed before Django 1.8.'
,
PendingDeprecationWarning
)
get_apps
()
# Load all the test model apps.
test_modules
=
get_test_modules
()
...
...
tests/test_runner/tests.py
Dosyayı görüntüle @
46789e76
...
...
@@ -10,8 +10,8 @@ from django.core.exceptions import ImproperlyConfigured
from
django.core.management
import
call_command
from
django
import
db
from
django.test
import
runner
,
TransactionTestCase
,
skipUnlessDBFeature
from
django.test.simple
import
DjangoTestSuiteRunner
,
get_tests
from
django.test.testcases
import
connections_support_transactions
from
django.test.utils
import
IgnorePendingDeprecationWarningsMixin
from
django.utils
import
unittest
from
django.utils.importlib
import
import_module
...
...
@@ -225,15 +225,17 @@ class Ticket17477RegressionTests(AdminScriptTestCase):
self
.
assertNoOutput
(
err
)
class
ModulesTestsPackages
(
unittest
.
TestCase
):
class
ModulesTestsPackages
(
IgnorePendingDeprecationWarningsMixin
,
unittest
.
TestCase
):
def
test_get_tests
(
self
):
"Check that the get_tests helper function can find tests in a directory"
from
django.test.simple
import
get_tests
module
=
import_module
(
TEST_APP_OK
)
tests
=
get_tests
(
module
)
self
.
assertIsInstance
(
tests
,
type
(
module
))
def
test_import_error
(
self
):
"Test for #12658 - Tests with ImportError's shouldn't fail silently"
from
django.test.simple
import
get_tests
module
=
import_module
(
TEST_APP_ERROR
)
self
.
assertRaises
(
ImportError
,
get_tests
,
module
)
...
...
@@ -258,7 +260,7 @@ class Sqlite3InMemoryTestDbs(unittest.TestCase):
},
})
other
=
db
.
connections
[
'other'
]
DjangoTestSuite
Runner
(
verbosity
=
0
)
.
setup_databases
()
runner
.
Discover
Runner
(
verbosity
=
0
)
.
setup_databases
()
msg
=
"DATABASES setting '
%
s' option set to sqlite3's ':memory:' value shouldn't interfere with transaction support detection."
%
option
# Transaction support should be properly initialised for the 'other' DB
self
.
assertTrue
(
other
.
features
.
supports_transactions
,
msg
)
...
...
@@ -273,12 +275,12 @@ class DummyBackendTest(unittest.TestCase):
"""
Test that setup_databases() doesn't fail with dummy database backend.
"""
runner
=
DjangoTestSuite
Runner
(
verbosity
=
0
)
runner
_instance
=
runner
.
Discover
Runner
(
verbosity
=
0
)
old_db_connections
=
db
.
connections
try
:
db
.
connections
=
db
.
ConnectionHandler
({})
old_config
=
runner
.
setup_databases
()
runner
.
teardown_databases
(
old_config
)
old_config
=
runner
_instance
.
setup_databases
()
runner
_instance
.
teardown_databases
(
old_config
)
except
Exception
as
e
:
self
.
fail
(
"setup_databases/teardown_databases unexpectedly raised "
"an error:
%
s"
%
e
)
...
...
tests/test_suite_override/tests.py
Dosyayı görüntüle @
46789e76
from
django.db.models
import
get_app
from
django.test.
simple
import
build_suite
from
django.test.
utils
import
IgnorePendingDeprecationWarningsMixin
from
django.utils
import
unittest
...
...
@@ -9,7 +9,7 @@ def suite():
return
testSuite
class
SuiteOverrideTest
(
unittest
.
TestCase
):
class
SuiteOverrideTest
(
IgnorePendingDeprecationWarningsMixin
,
unittest
.
TestCase
):
def
test_suite_override
(
self
):
"""
Validate that you can define a custom suite when running tests with
...
...
@@ -17,6 +17,7 @@ class SuiteOverrideTest(unittest.TestCase):
suite using ``build_suite``).
"""
from
django.test.simple
import
build_suite
app
=
get_app
(
"test_suite_override"
)
suite
=
build_suite
(
app
)
self
.
assertEqual
(
suite
.
countTestCases
(),
1
)
...
...
tests/test_utils/tests.py
Dosyayı görüntüle @
46789e76
...
...
@@ -8,8 +8,7 @@ from django.http import HttpResponse
from
django.template.loader
import
render_to_string
from
django.test
import
SimpleTestCase
,
TestCase
,
skipUnlessDBFeature
from
django.test.html
import
HTMLParseError
,
parse_html
from
django.test.simple
import
make_doctest
from
django.test.utils
import
CaptureQueriesContext
from
django.test.utils
import
CaptureQueriesContext
,
IgnorePendingDeprecationWarningsMixin
from
django.utils
import
six
from
django.utils
import
unittest
from
django.utils.unittest
import
skip
...
...
@@ -624,9 +623,10 @@ class AssertFieldOutputTests(SimpleTestCase):
self
.
assertFieldOutput
(
MyCustomField
,
{},
{},
empty_value
=
None
)
class
DoctestNormalizerTest
(
SimpleTestCase
):
class
DoctestNormalizerTest
(
IgnorePendingDeprecationWarningsMixin
,
SimpleTestCase
):
def
test_normalizer
(
self
):
from
django.test.simple
import
make_doctest
suite
=
make_doctest
(
"test_utils.doctest_output"
)
failures
=
unittest
.
TextTestRunner
(
stream
=
six
.
StringIO
())
.
run
(
suite
)
self
.
assertEqual
(
failures
.
failures
,
[])
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