Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added more precise assertions on two fixture tests.

  • Loading branch information...
commit 6492e8e5e6643c5a90d71727af7f17a362b9362b 1 parent 10a9c26
@claudep claudep authored
Showing with 6 additions and 10 deletions.
  1. +6 −10 tests/modeltests/fixtures/tests.py
View
16 tests/modeltests/fixtures/tests.py
@@ -185,18 +185,14 @@ def test_dumpdata_with_excludes(self):
exclude_list=['fixtures.Article', 'fixtures.Book', 'sites'])
# Excluding a bogus app should throw an error
- self.assertRaises(management.CommandError,
- self._dumpdata_assert,
- ['fixtures', 'sites'],
- '',
- exclude_list=['foo_app'])
+ with self.assertRaisesRegexp(management.CommandError,
+ "Unknown app in excludes: foo_app"):
+ self._dumpdata_assert(['fixtures', 'sites'], '', exclude_list=['foo_app'])
# Excluding a bogus model should throw an error
- self.assertRaises(management.CommandError,
- self._dumpdata_assert,
- ['fixtures', 'sites'],
- '',
- exclude_list=['fixtures.FooModel'])
+ with self.assertRaisesRegexp(management.CommandError,
+ "Unknown model in excludes: fixtures.FooModel"):
+ self._dumpdata_assert(['fixtures', 'sites'], '', exclude_list=['fixtures.FooModel'])
def test_dumpdata_with_filtering_manager(self):
spy1 = Spy.objects.create(name='Paul')
Please sign in to comment.
Something went wrong with that request. Please try again.