Untitled
from mongo import Aggregate, get_conn # from notebooks.edit_clients import create_bill_and_get_link # from notebooks.yclients_notebook_back import \ # get_loyalty_balance_bonus, get_client_data, \ # get_staff_for_filial, get_info_by_phone, get_records_for_phone # conn = get_conn() # acc = Aggregate(conn).get_param_acc_for_id('1q2w3e') # crm_data = {'name': 'yclients', 'branch': '4883', } # # # def test_get_info_by_phone(): # r = {'phone': 1, 'acc_id': 1} # res = get_info_by_phone(conn, r) # # # def test_get_loyalty_and_card_balance_for_checking_bonus_templates(): # visit_id = '343439229' # client_id = '121415095' # req = { # 'crm_data': crm_data, # 'visit_id': visit_id, # 'client_id': client_id, # } # res = get_loyalty_balance_bonus(conn, req) # print(res) # assert res['client_cards']['data'][0]['balance'] == 510.9 # # # def test_get_client_data(): # crm = {'name': 'yclients', 'branch': '4883', } # req = {'crm_data': crm, 'phone': '79111702764'} # res = get_client_data(conn, req) # print(res) # assert res.get('id') == 36604 # # # def test_get_staff_for_filial(): # res = get_staff_for_filial(conn, {'crm_data': crm_data}) # print(res) # assert res.get('total_count') == 1 # # # def test_get_record_info(): # # req = {'acc_id': '467043', 'phone': '79167848284'} # req = {'acc_id': '145612', 'phone': '79099159248'} # res_for_phone = get_records_for_phone(conn, req) # print(res_for_phone) # # # def create_bill_and_get_link(conn, request: dict): # # """Выставить счет и вернуть short url на оплату""" # # cost = int(request.get('amount')) # # description = request.get('description', '') # # length = int(request.get('month', 1)) # # branches_id = request.get('branch_list', []) # # res = create_bill_and_get_link_nb(conn, cost, description, length, branches_id) # # manage_log(request) # # return res # from notebooks.edit_clients import create_bill_and_get_link def get_bill_for_branch(): req = {'amount': 3890, 'description': 'Счет за услуги Бьюти Бот для филиала "Men&Women Beauty&Spa Северное" (952518) за месяц', 'month': 1, 'branch_list': '952518'} res = create_bill_and_get_link(conn, req) print(res) assert res if __name__ == '__main__': # test_get_info_by_phone() # test_get_loyalty_and_card_balance_for_checking_bonus_templates() # test_get_client_data() # test_get_staff_for_filial() # test_get_record_info() get_bill_for_branch()
Leave a Comment