mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as appropriate.
This commit is contained in:
@@ -9,7 +9,6 @@ from django.db.models.fields import NOT_PROVIDED
|
||||
from django.db.transaction import atomic
|
||||
from django.db.utils import IntegrityError
|
||||
from django.test import override_settings, skipUnlessDBFeature
|
||||
from django.utils import six
|
||||
|
||||
from .models import FoodManager, FoodQuerySet
|
||||
from .test_base import MigrationTestBase
|
||||
@@ -1607,16 +1606,12 @@ class OperationTests(OperationTestBase):
|
||||
)
|
||||
|
||||
with connection.schema_editor() as editor:
|
||||
six.assertRaisesRegex(self, ValueError,
|
||||
"Expected a 2-tuple but got 1",
|
||||
operation.database_forwards,
|
||||
"test_runsql", editor, project_state, new_state)
|
||||
with self.assertRaisesMessage(ValueError, "Expected a 2-tuple but got 1"):
|
||||
operation.database_forwards("test_runsql", editor, project_state, new_state)
|
||||
|
||||
with connection.schema_editor() as editor:
|
||||
six.assertRaisesRegex(self, ValueError,
|
||||
"Expected a 2-tuple but got 3",
|
||||
operation.database_backwards,
|
||||
"test_runsql", editor, new_state, project_state)
|
||||
with self.assertRaisesMessage(ValueError, "Expected a 2-tuple but got 3"):
|
||||
operation.database_backwards("test_runsql", editor, new_state, project_state)
|
||||
|
||||
def test_run_sql_noop(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user