From be9930d7bedc78486d5294a2914585e01c492385 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 6 Sep 2013 20:36:17 -0400 Subject: [PATCH] [1.6.x] Fixed deprecation warning on Python 3 Backport of b7451b72 from master. --- tests/serializers/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/serializers/tests.py b/tests/serializers/tests.py index 987a887f4b..ba5bb34434 100644 --- a/tests/serializers/tests.py +++ b/tests/serializers/tests.py @@ -487,8 +487,8 @@ class NoYamlSerializerTestCase(TestCase): def test_dumpdata_pyyaml_error_message(self): """Calling dumpdata produces an error when yaml package missing""" - self.assertRaisesRegexp(management.CommandError, YAML_IMPORT_ERROR_MESSAGE, - management.call_command, 'dumpdata', format='yaml') + with six.assertRaisesRegex(self, management.CommandError, YAML_IMPORT_ERROR_MESSAGE): + management.call_command('dumpdata', format='yaml') @unittest.skipUnless(HAS_YAML, "No yaml library detected")