diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py index 3b129a8ae8..1e0608f58c 100644 --- a/tests/migrations/test_loader.py +++ b/tests/migrations/test_loader.py @@ -179,9 +179,11 @@ class LoaderTests(TestCase): migration_loader.get_migration_by_prefix("migrations", "0001").name, "0001_initial", ) - with self.assertRaises(AmbiguityError): + msg = "There is more than one migration for 'migrations' with the prefix '0'" + with self.assertRaisesMessage(AmbiguityError, msg): migration_loader.get_migration_by_prefix("migrations", "0") - with self.assertRaises(KeyError): + msg = "There no migrations for 'migrations' with the prefix 'blarg'" + with self.assertRaisesMessage(KeyError, msg): migration_loader.get_migration_by_prefix("migrations", "blarg") def test_load_import_error(self):