1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #18196 -- Improved loaddata error messages.

This commit is contained in:
Claude Paroz
2012-08-21 21:52:25 +02:00
parent a193372753
commit 4353a6163c
3 changed files with 31 additions and 4 deletions

View File

@@ -126,6 +126,20 @@ class TestFixtures(TestCase):
commit=False,
)
@override_settings(SERIALIZATION_MODULES={'unkn': 'unexistent.path'})
def test_unimportable_serializer(self):
"""
Test that failing serializer import raises the proper error
"""
with self.assertRaisesRegexp(ImportError,
"No module named unexistent.path"):
management.call_command(
'loaddata',
'bad_fixture1.unkn',
verbosity=0,
commit=False,
)
def test_invalid_data(self):
"""
Test for ticket #4371 -- Loading a fixture file with invalid data