mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Refs #26022 -- Used context manager version of assertRaisesMessage in tests.
Follow up to 253adc2b8a.
This commit is contained in:
committed by
Mariusz Felisiak
parent
dbe436a9a9
commit
5627057f63
@@ -34,11 +34,11 @@ class M2MRegressionTests(TestCase):
|
||||
def test_internal_related_name_not_in_error_msg(self):
|
||||
# The secret internal related names for self-referential many-to-many
|
||||
# fields shouldn't appear in the list when an error is made.
|
||||
self.assertRaisesMessage(
|
||||
with self.assertRaisesMessage(
|
||||
FieldError,
|
||||
"Choices are: id, name, references, related, selfreferchild, selfreferchildsibling",
|
||||
lambda: SelfRefer.objects.filter(porcupine='fred')
|
||||
)
|
||||
):
|
||||
SelfRefer.objects.filter(porcupine='fred')
|
||||
|
||||
def test_m2m_inheritance_symmetry(self):
|
||||
# Test to ensure that the relationship between two inherited models
|
||||
|
||||
Reference in New Issue
Block a user