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:
@@ -7,7 +7,6 @@ from django.core.exceptions import FieldError
|
||||
from django.db import IntegrityError
|
||||
from django.db.models import Q
|
||||
from django.test import SimpleTestCase, TestCase
|
||||
from django.utils import six
|
||||
|
||||
from .models import (
|
||||
AllowsNullGFK, Animal, Carrot, Comparison, ConcreteRelatedModel,
|
||||
@@ -721,8 +720,8 @@ class TestInitWithNoneArgument(SimpleTestCase):
|
||||
def test_none_not_allowed(self):
|
||||
# TaggedItem requires a content_type, initializing with None should
|
||||
# raise a ValueError.
|
||||
with six.assertRaisesRegex(self, ValueError,
|
||||
'Cannot assign None: "TaggedItem.content_type" does not allow null values'):
|
||||
msg = 'Cannot assign None: "TaggedItem.content_type" does not allow null values'
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
TaggedItem(content_object=None)
|
||||
|
||||
def test_none_allowed(self):
|
||||
|
||||
Reference in New Issue
Block a user