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
7510b872
Kaydet (Commit)
7510b872
authored
Ara 31, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #25190 -- Removed callable_obj parameter to assertRaisesMessages().
Per deprecation timeline.
üst
9f9a3d64
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
36 deletions
+6
-36
testcases.py
django/test/testcases.py
+2
-10
2.0.txt
docs/releases/2.0.txt
+3
-0
tools.txt
docs/topics/testing/tools.txt
+0
-5
tests.py
tests/test_utils/tests.py
+1
-21
No files found.
django/test/testcases.py
Dosyayı görüntüle @
7510b872
...
...
@@ -6,7 +6,6 @@ import posixpath
import
sys
import
threading
import
unittest
import
warnings
from
collections
import
Counter
from
contextlib
import
contextmanager
from
copy
import
copy
...
...
@@ -36,7 +35,6 @@ from django.test.utils import (
)
from
django.utils
import
six
from
django.utils.decorators
import
classproperty
from
django.utils.deprecation
import
RemovedInDjango20Warning
from
django.utils.encoding
import
force_text
from
django.utils.six.moves.urllib.parse
import
(
unquote
,
urljoin
,
urlparse
,
urlsplit
,
...
...
@@ -606,14 +604,8 @@ class SimpleTestCase(unittest.TestCase):
args: Function to be called and extra positional args.
kwargs: Extra kwargs.
"""
# callable_obj was a documented kwarg in Django 1.8 and older.
callable_obj
=
kwargs
.
pop
(
'callable_obj'
,
None
)
if
callable_obj
:
warnings
.
warn
(
'The callable_obj kwarg is deprecated. Pass the callable '
'as a positional argument instead.'
,
RemovedInDjango20Warning
)
elif
len
(
args
):
callable_obj
=
None
if
len
(
args
):
callable_obj
=
args
[
0
]
args
=
args
[
1
:]
...
...
docs/releases/2.0.txt
Dosyayı görüntüle @
7510b872
...
...
@@ -306,3 +306,6 @@ these features.
* The ``current_app`` parameter to the ``contrib.auth`` function-based views is
removed.
* The ``callable_obj`` keyword argument to
``SimpleTestCase.assertRaisesMessage()`` is removed.
docs/topics/testing/tools.txt
Dosyayı görüntüle @
7510b872
...
...
@@ -1351,11 +1351,6 @@ your test suite.
with self.assertRaisesMessage(ValueError, 'invalid literal for int()'):
int('a')
.. deprecated:: 1.9
Passing ``callable`` as a keyword argument called ``callable_obj`` is
deprecated. Pass the callable as a positional argument instead.
.. method:: SimpleTestCase.assertFieldOutput(fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value='')
Asserts that a form field behaves correctly with various inputs.
...
...
tests/test_utils/tests.py
Dosyayı görüntüle @
7510b872
...
...
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
import
sys
import
unittest
import
warnings
from
django.conf.urls
import
url
from
django.contrib.staticfiles.finders
import
get_finder
,
get_finders
...
...
@@ -14,8 +13,7 @@ from django.forms import EmailField, IntegerField
from
django.http
import
HttpResponse
from
django.template.loader
import
render_to_string
from
django.test
import
(
SimpleTestCase
,
TestCase
,
ignore_warnings
,
skipIfDBFeature
,
skipUnlessDBFeature
,
SimpleTestCase
,
TestCase
,
skipIfDBFeature
,
skipUnlessDBFeature
,
)
from
django.test.html
import
HTMLParseError
,
parse_html
from
django.test.utils
import
(
...
...
@@ -25,7 +23,6 @@ from django.test.utils import (
from
django.urls
import
NoReverseMatch
,
reverse
from
django.utils
import
six
from
django.utils._os
import
abspathu
from
django.utils.deprecation
import
RemovedInDjango20Warning
from
.models
import
Car
,
Person
,
PossessedCar
from
.views
import
empty_response
...
...
@@ -831,23 +828,6 @@ class AssertRaisesMsgTest(SimpleTestCase):
with
self
.
assertRaisesMessage
(
ValueError
,
"[.*x+]y?"
):
func1
()
@ignore_warnings
(
category
=
RemovedInDjango20Warning
)
def
test_callable_obj_param
(
self
):
# callable_obj was a documented kwarg in Django 1.8 and older.
def
func1
():
raise
ValueError
(
"[.*x+]y?"
)
with
warnings
.
catch_warnings
(
record
=
True
)
as
warns
:
warnings
.
simplefilter
(
'always'
)
self
.
assertRaisesMessage
(
ValueError
,
"[.*x+]y?"
,
callable_obj
=
func1
)
self
.
assertEqual
(
len
(
warns
),
1
)
self
.
assertEqual
(
str
(
warns
[
0
]
.
message
),
'The callable_obj kwarg is deprecated. Pass the callable '
'as a positional argument instead.'
)
class
AssertFieldOutputTests
(
SimpleTestCase
):
...
...
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