diff --git a/tests/test_database.py b/tests/test_database.py index c563862..2a50590 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -150,7 +150,7 @@ class DatabaseTestCase(TestCaseWithData): exc = cm.exception self.assertEqual(exc.code, 193) - self.assertEqual(exc.message, 'Wrong password for user default') + self.assertTrue(exc.message.startswith('Wrong password for user default')) def test_nonexisting_db(self): db = Database('db_not_here', autocreate=False) @@ -158,7 +158,7 @@ class DatabaseTestCase(TestCaseWithData): db.create_table(Person) exc = cm.exception self.assertEqual(exc.code, 81) - self.assertEqual(exc.message, "Database db_not_here doesn't exist") + self.assertTrue(exc.message.startswith("Database db_not_here doesn't exist")) # Create and delete the db twice, to ensure db_exists gets updated for i in range(2): # Now create the database - should succeed diff --git a/tests/test_engines.py b/tests/test_engines.py index 7e29426..846e825 100644 --- a/tests/test_engines.py +++ b/tests/test_engines.py @@ -209,7 +209,7 @@ class DistributedTestCase(_EnginesHelperTestCase): exc = cm.exception self.assertEqual(exc.code, 170) - self.assertEqual(exc.message, "Requested cluster 'cluster_name' not found") + self.assertTrue(exc.message.startswith("Requested cluster 'cluster_name' not found")) def test_verbose_engine_two_superclasses(self): class TestModel2(SampleModel): diff --git a/tests/test_readonly.py b/tests/test_readonly.py index b9333af..816c701 100644 --- a/tests/test_readonly.py +++ b/tests/test_readonly.py @@ -36,9 +36,9 @@ class ReadonlyTestCase(TestCaseWithData): def _check_db_readonly_err(self, exc, drop_table=None): self.assertEqual(exc.code, 164) if drop_table: - self.assertEqual(exc.message, 'Cannot drop table in readonly mode') + self.assertTrue(exc.message.startswith('Cannot drop table in readonly mode')) else: - self.assertEqual(exc.message, 'Cannot insert into table in readonly mode') + self.assertTrue(exc.message.startswith('Cannot insert into table in readonly mode')) def test_readonly_db_with_default_user(self): self._test_readonly_db('default')