Permalink
Browse files

Added more precise assertions on two fixture tests.

  • Loading branch information...
1 parent 10a9c26 commit 6492e8e5e6643c5a90d71727af7f17a362b9362b @claudep claudep committed Jun 7, 2012
Showing with 6 additions and 10 deletions.
  1. +6 −10 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')

0 comments on commit 6492e8e

Please sign in to comment.