mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #26022 -- Used context manager version of assertRaisesMessage in tests.
This commit is contained in:
@@ -1355,9 +1355,8 @@ class M2mThroughFieldsTests(SimpleTestCase):
|
||||
class Fan(models.Model):
|
||||
pass
|
||||
|
||||
self.assertRaisesMessage(
|
||||
ValueError, 'Cannot specify through_fields without a through model',
|
||||
models.ManyToManyField, Fan, through_fields=('f1', 'f2'))
|
||||
with self.assertRaisesMessage(ValueError, 'Cannot specify through_fields without a through model'):
|
||||
models.ManyToManyField(Fan, through_fields=('f1', 'f2'))
|
||||
|
||||
def test_invalid_order(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user