diff options
| author | Hasan <hasan.r67@gmail.com> | 2016-01-18 12:15:45 +0330 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-01-29 13:37:33 -0500 |
| commit | 26ad01719d73823e65c0358a2ee9941e0a888a63 (patch) | |
| tree | 9e458f4c3428400e0970554ce19f6ed02e862a3b /tests/fixtures_regress/tests.py | |
| parent | 253adc2b8a52982139d40c4f55b3fd446e1cb8f3 (diff) | |
Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as appropriate.
Diffstat (limited to 'tests/fixtures_regress/tests.py')
| -rw-r--r-- | tests/fixtures_regress/tests.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py index 6b4a3f7673..3a47d2617f 100644 --- a/tests/fixtures_regress/tests.py +++ b/tests/fixtures_regress/tests.py @@ -201,9 +201,8 @@ class TestFixtures(TestCase): Test for ticket #4371 -- Loading data of an unknown format should fail Validate that error conditions are caught correctly """ - with six.assertRaisesRegex(self, management.CommandError, - "Problem installing fixture 'bad_fixture1': " - "unkn is not a known serialization format."): + msg = "Problem installing fixture 'bad_fixture1': unkn is not a known serialization format." + with self.assertRaisesMessage(management.CommandError, msg): management.call_command( 'loaddata', 'bad_fixture1.unkn', @@ -460,8 +459,7 @@ class TestFixtures(TestCase): """ Regression for #3615 - Ensure data with nonexistent child key references raises error """ - with six.assertRaisesRegex(self, IntegrityError, - "Problem installing fixture"): + with self.assertRaisesMessage(IntegrityError, "Problem installing fixture"): management.call_command( 'loaddata', 'forward_ref_bad_data.json', @@ -489,9 +487,8 @@ class TestFixtures(TestCase): """ Regression for #7043 - Error is quickly reported when no fixtures is provided in the command line. """ - with six.assertRaisesRegex(self, management.CommandError, - "No database fixture specified. Please provide the path of " - "at least one fixture in the command line."): + msg = "No database fixture specified. Please provide the path of at least one fixture in the command line." + with self.assertRaisesMessage(management.CommandError, msg): management.call_command( 'loaddata', verbosity=0, |
