[1.6.x] Fixed deprecation warning on Python 3

Backport of b7451b72 from master.
This commit is contained in:
Tim Graham 2013-09-06 20:36:17 -04:00 committed by Aymeric Augustin
parent 63b95ca452
commit be9930d7be
1 changed files with 2 additions and 2 deletions

View File

@ -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")