summaryrefslogtreecommitdiff
path: root/tests/fixtures_regress
diff options
context:
space:
mode:
authorSenko Rasic <senko.rasic@dobarkod.hr>2013-05-18 17:51:14 +0200
committerSenko Rasic <senko.rasic@dobarkod.hr>2013-05-19 10:56:09 +0200
commitcc3b3ba93a7bfdd2ece739e97e36150a719acd3e (patch)
tree6a54337aa8f1ca72e1bb1bf1eefa3b09f09131f4 /tests/fixtures_regress
parent0a50311063c416ec4d39f518e8d8110dd7eddbdf (diff)
Fixed #18990: Loaddata now complains if fixture doesn't exist
The fixture named "initial_data" is exceptional though; if it doesn't exist, the error is not raised. This allows syncdb and flush management commands to attempt to load it without causing an error if it doesn't exist.
Diffstat (limited to 'tests/fixtures_regress')
-rw-r--r--tests/fixtures_regress/tests.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py
index 02e923e386..df84d77a3f 100644
--- a/tests/fixtures_regress/tests.py
+++ b/tests/fixtures_regress/tests.py
@@ -441,13 +441,14 @@ class TestFixtures(TestCase):
def test_loaddata_not_existant_fixture_file(self):
stdout_output = StringIO()
- management.call_command(
- 'loaddata',
- 'this_fixture_doesnt_exist',
- verbosity=2,
- commit=False,
- stdout=stdout_output,
- )
+ with self.assertRaises(management.CommandError):
+ management.call_command(
+ 'loaddata',
+ 'this_fixture_doesnt_exist',
+ verbosity=2,
+ commit=False,
+ stdout=stdout_output,
+ )
self.assertTrue("No xml fixture 'this_fixture_doesnt_exist' in" in
force_text(stdout_output.getvalue()))