def test_retry_called_on_exception(self): _db_handler.remove_field.side_effect = Exception transaction._release_lock_task.retry = MagicMock() transaction._release_lock_task(self.transaction.transaction_field, self.transaction.id_field, self.transaction.transaction_id) transaction._release_lock_task.retry.assert_called_once()
def test_handler_remove_field_called(self): remove_field = {self.transaction.transaction_field: ""} update_filter = { self.transaction.id_field: self.transaction.transaction_id } transaction._release_lock_task(self.transaction.transaction_field, self.transaction.id_field, self.transaction.transaction_id) transaction._db_handler.remove_field.assert_called_once_with( "logs", remove_field, update_filter)