summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-08-04 09:15:23 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-08-04 09:20:26 +0200
commit52f9cfee9fbe9e19faf8a44e1063da8a3ec07ea7 (patch)
tree2b460c7b670f37ed68e60fdf7a3f054fbbdb91e6 /tests
parent7afca03c4058c25f2e1cec8d0b07c2157c93e831 (diff)
Used assertRaisesMessage() to test MigrationLoader.get_migration_by_prefix()'s error messages.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_loader.py6
1 files changed, 4 insertions, 2 deletions
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):