Added more precise assertions on two fixture tests.
This commit is contained in:
parent
10a9c260fc
commit
6492e8e5e6
|
@ -185,18 +185,14 @@ class FixtureLoadingTests(TestCase):
|
||||||
exclude_list=['fixtures.Article', 'fixtures.Book', 'sites'])
|
exclude_list=['fixtures.Article', 'fixtures.Book', 'sites'])
|
||||||
|
|
||||||
# Excluding a bogus app should throw an error
|
# Excluding a bogus app should throw an error
|
||||||
self.assertRaises(management.CommandError,
|
with self.assertRaisesRegexp(management.CommandError,
|
||||||
self._dumpdata_assert,
|
"Unknown app in excludes: foo_app"):
|
||||||
['fixtures', 'sites'],
|
self._dumpdata_assert(['fixtures', 'sites'], '', exclude_list=['foo_app'])
|
||||||
'',
|
|
||||||
exclude_list=['foo_app'])
|
|
||||||
|
|
||||||
# Excluding a bogus model should throw an error
|
# Excluding a bogus model should throw an error
|
||||||
self.assertRaises(management.CommandError,
|
with self.assertRaisesRegexp(management.CommandError,
|
||||||
self._dumpdata_assert,
|
"Unknown model in excludes: fixtures.FooModel"):
|
||||||
['fixtures', 'sites'],
|
self._dumpdata_assert(['fixtures', 'sites'], '', exclude_list=['fixtures.FooModel'])
|
||||||
'',
|
|
||||||
exclude_list=['fixtures.FooModel'])
|
|
||||||
|
|
||||||
def test_dumpdata_with_filtering_manager(self):
|
def test_dumpdata_with_filtering_manager(self):
|
||||||
spy1 = Spy.objects.create(name='Paul')
|
spy1 = Spy.objects.create(name='Paul')
|
||||||
|
|
Loading…
Reference in New Issue