diff options
author | Tim Graham <timograham@gmail.com> | 2016-12-07 17:42:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-07 17:42:31 -0500 |
commit | b5f0b3478dfcf0335f8ac2038d59f54b4a05f2a0 (patch) | |
tree | f3eb61bfdcf45c7b27fe3c480e9a7533746d1aad /tests/m2m_regress | |
parent | f909fa84bedb51778a175aadfe4cfe7a91fe06cd (diff) | |
download | django-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.py | 8 |
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') ) |