Fixed typos in migrations tests, comments, and error message.
This commit is contained in:
parent
52f9cfee9f
commit
202d3e193a
|
@ -32,7 +32,7 @@ class Command(BaseCommand):
|
||||||
# Get the database we're operating from
|
# Get the database we're operating from
|
||||||
connection = connections[options['database']]
|
connection = connections[options['database']]
|
||||||
|
|
||||||
# Load up an loader to get all the migration data, but don't replace
|
# Load up a loader to get all the migration data, but don't replace
|
||||||
# migrations.
|
# migrations.
|
||||||
loader = MigrationLoader(connection, replace_migrations=False)
|
loader = MigrationLoader(connection, replace_migrations=False)
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,10 @@ class MigrationLoader:
|
||||||
"There is more than one migration for '%s' with the prefix '%s'" % (app_label, name_prefix)
|
"There is more than one migration for '%s' with the prefix '%s'" % (app_label, name_prefix)
|
||||||
)
|
)
|
||||||
elif not results:
|
elif not results:
|
||||||
raise KeyError("There no migrations for '%s' with the prefix '%s'" % (app_label, name_prefix))
|
raise KeyError(
|
||||||
|
f"There is no migration for '{app_label}' with the prefix "
|
||||||
|
f"'{name_prefix}'"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
return self.disk_migrations[results[0]]
|
return self.disk_migrations[results[0]]
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ class LoaderTests(TestCase):
|
||||||
msg = "There is more than one migration for 'migrations' with the prefix '0'"
|
msg = "There is more than one migration for 'migrations' with the prefix '0'"
|
||||||
with self.assertRaisesMessage(AmbiguityError, msg):
|
with self.assertRaisesMessage(AmbiguityError, msg):
|
||||||
migration_loader.get_migration_by_prefix("migrations", "0")
|
migration_loader.get_migration_by_prefix("migrations", "0")
|
||||||
msg = "There no migrations for 'migrations' with the prefix 'blarg'"
|
msg = "There is no migration for 'migrations' with the prefix 'blarg'"
|
||||||
with self.assertRaisesMessage(KeyError, msg):
|
with self.assertRaisesMessage(KeyError, msg):
|
||||||
migration_loader.get_migration_by_prefix("migrations", "blarg")
|
migration_loader.get_migration_by_prefix("migrations", "blarg")
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ class LoaderTests(TestCase):
|
||||||
loader.build_graph()
|
loader.build_graph()
|
||||||
self.assertEqual(num_nodes(), 3)
|
self.assertEqual(num_nodes(), 3)
|
||||||
|
|
||||||
# Starting at 5 to 7 we are passed the squashed migrations
|
# Starting at 5 to 7 we are past the squashed migrations.
|
||||||
self.record_applied(recorder, 'migrations', '5_auto')
|
self.record_applied(recorder, 'migrations', '5_auto')
|
||||||
loader.build_graph()
|
loader.build_graph()
|
||||||
self.assertEqual(num_nodes(), 2)
|
self.assertEqual(num_nodes(), 2)
|
||||||
|
|
Loading…
Reference in New Issue