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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user