mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Refs #26022 -- Used context manager version of assertRaises in tests.
This commit is contained in:
parent
575706331b
commit
3d0dcd7f5a
118 changed files with 1086 additions and 760 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue