feat: 도매상 API 통합 및 스키마 업데이트
- wholesale 패키지 연동 (SooinSession, GeoYoungSession) - Flask Blueprint 분리 (sooin_api.py, geoyoung_api.py) - order_context 스키마 확장 (wholesaler_id, internal_code 등) - 수인약품 개별 취소 기능 (cancel_item, restore_item) - 문서 추가: WHOLESALE_API_INTEGRATION.md - 테스트 스크립트들
This commit is contained in:
38
backend/test_del_one.py
Normal file
38
backend/test_del_one.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""개별 삭제 테스트"""
|
||||
from sooin_api import SooinSession
|
||||
|
||||
session = SooinSession()
|
||||
session.login()
|
||||
|
||||
# 1. 장바구니 비우기
|
||||
session.clear_cart()
|
||||
print('1. 장바구니 비움')
|
||||
|
||||
# 2. 두 개 담기
|
||||
session.order_product('073100220', 1, '30T') # 코자정
|
||||
print('2. 코자정 담음')
|
||||
|
||||
session.order_product('652100640', 1) # 스틸녹스
|
||||
print('3. 스틸녹스 담음')
|
||||
|
||||
# 장바구니 확인
|
||||
cart = session.get_cart()
|
||||
count = cart.get('total_items', 0)
|
||||
print(f' 현재 장바구니: {count}개')
|
||||
for item in cart.get('items', []):
|
||||
print(f' - {item.get("product_name", "")}')
|
||||
|
||||
# 3. 첫 번째 항목만 삭제 (idx=0)
|
||||
print('\n4. idx=0 (첫 번째) 삭제...')
|
||||
resp = session.session.get(
|
||||
'http://sooinpharm.co.kr/Service/Order/BagOrder.asp',
|
||||
params={'kind': 'delOne', 'idx': '0', 'currVenCd': '50911'}
|
||||
)
|
||||
|
||||
# 장바구니 다시 확인
|
||||
cart = session.get_cart()
|
||||
count = cart.get('total_items', 0)
|
||||
print(f' 삭제 후: {count}개')
|
||||
for item in cart.get('items', []):
|
||||
print(f' - {item.get("product_name", "")}')
|
||||
Reference in New Issue
Block a user