mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as appropriate.
This commit is contained in:
parent
253adc2b8a
commit
26ad01719d
23 changed files with 124 additions and 221 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue