接入本地订单测试表并替换模拟查单
This commit is contained in:
@@ -45,6 +45,14 @@ class ApiTests(unittest.TestCase):
|
||||
self.root = Path(self.directory.name)
|
||||
self.app = self.application(self.root)
|
||||
self.client = self.app.test_client()
|
||||
from logistics_chat.order_data import import_records
|
||||
with self.app.app_context():
|
||||
connection = db.connect()
|
||||
import_records(connection, [{'tenant_id':'fixture', 'order_no':'15252125',
|
||||
'status':'PROCESSING', 'country_code':'US', 'gross_weight_kg':'30',
|
||||
'history_json':[{'time':'2026-10-28 10:00', 'status':'SUBMITTED'}]}])
|
||||
connection.commit()
|
||||
connection.close()
|
||||
|
||||
def application(self, root):
|
||||
return create_app({'TESTING': True, 'DATABASE': root/'history.db',
|
||||
|
||||
Reference in New Issue
Block a user