1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as appropriate.

This commit is contained in:
Hasan
2016-01-18 12:15:45 +03:30
committed by Tim Graham
parent 253adc2b8a
commit 26ad01719d
23 changed files with 124 additions and 221 deletions

View File

@@ -5,7 +5,6 @@ from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import GEOSGeometry
from django.forms import ValidationError
from django.test import SimpleTestCase, override_settings, skipUnlessDBFeature
from django.utils import six
from django.utils.html import escape
@@ -40,8 +39,7 @@ class GeometryFieldTest(SimpleTestCase):
"Testing GeometryField's handling of null (None) geometries."
# Form fields, by default, are required (`required=True`)
fld = forms.GeometryField()
with six.assertRaisesRegex(self, forms.ValidationError,
"No geometry value provided."):
with self.assertRaisesMessage(forms.ValidationError, "No geometry value provided."):
fld.clean(None)
# This will clean None as a geometry (See #10660).