summaryrefslogtreecommitdiff
path: root/tests/fixtures_regress
diff options
context:
space:
mode:
authorSenko Rasic <senko.rasic@dobarkod.hr>2013-05-19 11:20:10 +0200
committerSenko Rasic <senko.rasic@dobarkod.hr>2013-05-19 11:31:27 +0200
commitc44a2c40fe0ed79b0fa00233a204d41e9c677750 (patch)
tree28ffd80082bb94eb3299f059e960b56afaf96065 /tests/fixtures_regress
parentcc3b3ba93a7bfdd2ece739e97e36150a719acd3e (diff)
Fixed #18990 -- Loaddata now complains if fixture doesn't exist
If the fixture doesn't exist, loaddata will output a warning. The fixture named "initial_data" is exceptional though; if it doesn't exist, the warning is not emitted. This allows syncdb and flush management commands to attempt to load it without causing spurious warnings. Thanks to Derega, ptone, dirigeant and d1ffuz0r for contributions to the ticket.
Diffstat (limited to 'tests/fixtures_regress')
-rw-r--r--tests/fixtures_regress/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py
index df84d77a3f..97ad6c326a 100644
--- a/tests/fixtures_regress/tests.py
+++ b/tests/fixtures_regress/tests.py
@@ -441,7 +441,8 @@ class TestFixtures(TestCase):
def test_loaddata_not_existant_fixture_file(self):
stdout_output = StringIO()
- with self.assertRaises(management.CommandError):
+ import warnings
+ with warnings.catch_warnings(record=True):
management.call_command(
'loaddata',
'this_fixture_doesnt_exist',