summaryrefslogtreecommitdiff
path: root/tests/m2m_regress
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-12-07 17:42:31 -0500
committerGitHub <noreply@github.com>2016-12-07 17:42:31 -0500
commitb5f0b3478dfcf0335f8ac2038d59f54b4a05f2a0 (patch)
treef3eb61bfdcf45c7b27fe3c480e9a7533746d1aad /tests/m2m_regress
parentf909fa84bedb51778a175aadfe4cfe7a91fe06cd (diff)
downloaddjango-b5f0b3478dfcf0335f8ac2038d59f54b4a05f2a0.tar.gz
Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.
Diffstat (limited to 'tests/m2m_regress')
-rw-r--r--tests/m2m_regress/tests.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/m2m_regress/tests.py b/tests/m2m_regress/tests.py
index 88b7ebb952..3c882c595a 100644
--- a/tests/m2m_regress/tests.py
+++ b/tests/m2m_regress/tests.py
@@ -2,7 +2,6 @@ from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
-from django.utils import six
from .models import (
Entry, Line, Post, RegressionModelSplit, SelfRefer, SelfReferChild,
@@ -37,10 +36,9 @@ class M2MRegressionTests(TestCase):
def test_internal_related_name_not_in_error_msg(self):
# The secret internal related names for self-referential many-to-many
# fields shouldn't appear in the list when an error is made.
-
- six.assertRaisesRegex(
- self, FieldError,
- "Choices are: id, name, references, related, selfreferchild, selfreferchildsibling$",
+ self.assertRaisesMessage(
+ FieldError,
+ "Choices are: id, name, references, related, selfreferchild, selfreferchildsibling",
lambda: SelfRefer.objects.filter(porcupine='fred')
)