from Utils.sql_handler import test_env_conn from TestData.inbox.ticketInfo_test_data import ticketInfoData ticket_info_select_sql = f'select * from im_room where room_id = {ticketInfoData.roomId} and room_type != 2' ticket_info_result = test_env_conn.select_one_value(sql=ticket_info_select_sql) setattr(ticketInfoData, 'ticketCustomerImage', ticket_info_result['first_send_avatar']) setattr(ticketInfoData, 'ticketCustomerName', ticket_info_result['first_send_name']) setattr(ticketInfoData, 'ticketLastMsg', ticket_info_result['last_msg_context']) setattr(ticketInfoData, 'ticketLastMsgTime', str(ticket_info_result['last_msg_time'])) setattr(ticketInfoData, 'ticketTitle', ticket_info_result['title'])