def send(data, resp_json, status=200, logger=None): handler = get_handler('smstraffic') responses.add(responses.POST, handler.base_url, body=json.dumps(resp_json), status=status) if logger is None: logger = Mock() handler.send(data, logger=logger) return logger
def use_db_logger(): handler = get_handler('smstraffic') handler.send({'user': '******'}, db_logger)