mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #26022 -- Used context manager version of assertRaises in tests.
This commit is contained in:
@@ -221,10 +221,8 @@ class UtilsTests(SimpleTestCase):
|
||||
str("article")
|
||||
)
|
||||
|
||||
self.assertRaises(
|
||||
AttributeError,
|
||||
lambda: label_for_field("unknown", Article)
|
||||
)
|
||||
with self.assertRaises(AttributeError):
|
||||
label_for_field("unknown", Article)
|
||||
|
||||
def test_callable(obj):
|
||||
return "nothing"
|
||||
|
||||
Reference in New Issue
Block a user