mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #26022 -- Used context manager version of assertRaises in tests.
This commit is contained in:
@@ -57,7 +57,8 @@ class MultiColumnFKTests(TestCase):
|
||||
membership = Membership.objects.create(
|
||||
membership_country_id=self.usa.id, person_id=self.jane.id, group_id=self.cia.id)
|
||||
|
||||
self.assertRaises(Person.DoesNotExist, getattr, membership, 'person')
|
||||
with self.assertRaises(Person.DoesNotExist):
|
||||
getattr(membership, 'person')
|
||||
|
||||
def test_reverse_query_returns_correct_result(self):
|
||||
# Creating a valid membership because it has the same country has the person
|
||||
|
||||
Reference in New Issue
Block a user