1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Advanced pending deprecation warnings.

Also added stacklevel argument, fixed #18127.
This commit is contained in:
Aymeric Augustin
2012-12-25 21:07:27 +01:00
parent 130829334c
commit ef017a5f00
12 changed files with 24 additions and 23 deletions

View File

@@ -139,14 +139,14 @@ class SortedDictTests(SimpleTestCase):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
d.insert(0, "hello", "world")
assert w[0].category is PendingDeprecationWarning
assert w[0].category is DeprecationWarning
def test_value_for_index(self):
d = SortedDict({"a": 3})
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
self.assertEqual(d.value_for_index(0), 3)
assert w[0].category is PendingDeprecationWarning
assert w[0].category is DeprecationWarning
class MergeDictTests(SimpleTestCase):