mirror of https://github.com/django/django.git
Fixed loaddata error message when uncompressed fixture has a dot in its name.
This commit is contained in:
parent
e40e7026ca
commit
91841c77cd
|
@ -327,7 +327,7 @@ class Command(BaseCommand):
|
|||
else:
|
||||
raise CommandError(
|
||||
"Problem installing fixture '%s': %s is not a known "
|
||||
"serialization format." % (''.join(parts[:-1]), parts[-1]))
|
||||
"serialization format." % ('.'.join(parts[:-1]), parts[-1]))
|
||||
else:
|
||||
ser_fmt = None
|
||||
|
||||
|
|
|
@ -182,11 +182,11 @@ class TestFixtures(TestCase):
|
|||
Test for ticket #4371 -- Loading data of an unknown format should fail
|
||||
Validate that error conditions are caught correctly
|
||||
"""
|
||||
msg = "Problem installing fixture 'bad_fixture1': unkn is not a known serialization format."
|
||||
msg = "Problem installing fixture 'bad_fix.ture1': unkn is not a known serialization format."
|
||||
with self.assertRaisesMessage(management.CommandError, msg):
|
||||
management.call_command(
|
||||
'loaddata',
|
||||
'bad_fixture1.unkn',
|
||||
'bad_fix.ture1.unkn',
|
||||
verbosity=0,
|
||||
)
|
||||
|
||||
|
@ -198,7 +198,7 @@ class TestFixtures(TestCase):
|
|||
with self.assertRaisesMessage(ImportError, "No module named 'unexistent'"):
|
||||
management.call_command(
|
||||
'loaddata',
|
||||
'bad_fixture1.unkn',
|
||||
'bad_fix.ture1.unkn',
|
||||
verbosity=0,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue