Fixed loaddata error message when uncompressed fixture has a dot in its name.

This commit is contained in:
Sergey Fedoseev 2018-09-27 00:30:15 +05:00 committed by Tim Graham
parent e40e7026ca
commit 91841c77cd
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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,
)