summaryrefslogtreecommitdiff
path: root/tests/fixtures
diff options
context:
space:
mode:
authorHasan <hasan.r67@gmail.com>2016-01-18 12:15:45 +0330
committerTim Graham <timograham@gmail.com>2016-01-29 13:37:33 -0500
commit26ad01719d73823e65c0358a2ee9941e0a888a63 (patch)
tree9e458f4c3428400e0970554ce19f6ed02e862a3b /tests/fixtures
parent253adc2b8a52982139d40c4f55b3fd446e1cb8f3 (diff)
downloaddjango-26ad01719d73823e65c0358a2ee9941e0a888a63.tar.gz
Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as appropriate.
Diffstat (limited to 'tests/fixtures')
-rw-r--r--tests/fixtures/tests.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/fixtures/tests.py b/tests/fixtures/tests.py
index b151797c98..e7a105532a 100644
--- a/tests/fixtures/tests.py
+++ b/tests/fixtures/tests.py
@@ -364,13 +364,11 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
)
# Excluding a bogus app should throw an error
- with six.assertRaisesRegex(self, management.CommandError,
- "No installed app with label 'foo_app'."):
+ with self.assertRaisesMessage(management.CommandError, "No installed app with label 'foo_app'."):
self._dumpdata_assert(['fixtures', 'sites'], '', exclude_list=['foo_app'])
# Excluding a bogus model should throw an error
- with six.assertRaisesRegex(self, management.CommandError,
- "Unknown model in excludes: fixtures.FooModel"):
+ with self.assertRaisesMessage(management.CommandError, "Unknown model in excludes: fixtures.FooModel"):
self._dumpdata_assert(['fixtures', 'sites'], '', exclude_list=['fixtures.FooModel'])
@unittest.skipIf(sys.platform.startswith('win'), "Windows doesn't support '?' in filenames.")
@@ -415,8 +413,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
primary_keys='2'
)
- with six.assertRaisesRegex(self, management.CommandError,
- "You can only use --pks option with one model"):
+ with self.assertRaisesMessage(management.CommandError, "You can only use --pks option with one model"):
self._dumpdata_assert(
['fixtures'],
'[{"pk": 2, "model": "fixtures.article", "fields": {"headline": "Poker has no place on ESPN", '
@@ -425,8 +422,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
primary_keys='2,3'
)
- with six.assertRaisesRegex(self, management.CommandError,
- "You can only use --pks option with one model"):
+ with self.assertRaisesMessage(management.CommandError, "You can only use --pks option with one model"):
self._dumpdata_assert(
'',
'[{"pk": 2, "model": "fixtures.article", "fields": {"headline": "Poker has no place on ESPN", '
@@ -435,8 +431,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
primary_keys='2,3'
)
- with six.assertRaisesRegex(self, management.CommandError,
- "You can only use --pks option with one model"):
+ with self.assertRaisesMessage(management.CommandError, "You can only use --pks option with one model"):
self._dumpdata_assert(
['fixtures.Article', 'fixtures.category'],
'[{"pk": 2, "model": "fixtures.article", "fields": {"headline": "Poker has no place on ESPN", '