def test_check_database_version_supported(self, mocked_get_database_version): if connection.mysql_is_mariadb: mocked_get_database_version.return_value = (10, 3) msg = "MariaDB 10.4 or later is required (found 10.3)." else: mocked_get_database_version.return_value = (5, 6) msg = "MySQL 5.7 or later is required (found 5.6)." with self.assertRaisesMessage(NotSupportedError, msg): connection.check_database_version_supported() self.assertTrue(mocked_get_database_version.called)
def test_check_database_version_supported(self, mocked_get_database_version): msg = "Oracle 19 or later is required (found 18.1)." with self.assertRaisesMessage(NotSupportedError, msg): connection.check_database_version_supported() self.assertTrue(mocked_get_database_version.called)
def test_check_database_version_supported_with_none_as_database_version( self): with patch.object(connection.features, "minimum_database_version", None): connection.check_database_version_supported()