accounting/test/open_account.py

30 lines
757 B
Python
Raw Normal View History

2024-09-21 20:39:47 +08:00
from run_test import run
from appPublic.log import debug
from sqlor.dbpools import DBPools
from accounting.openaccount import openAllCustomerAccounts, \
openOwnerAccounts, openAllProviderAccounts, openAllResellerAccounts
async def OpenAccount():
orgid = '_VaV5trl8faujgr7xaE3D'
db = DBPools()
async with db.sqlorContext('sage') as sor:
try:
await openAllCustomerAccounts(sor, orgid)
except Exception as e:
debug(f'{e}')
try:
await openOwnerAccounts(sor, orgid)
except Exception as e:
debug(f'{e}')
try:
await openAllProviderAccounts(sor, orgid)
except Exception as e:
debug(f'{e}')
try:
await openAllResellerAccounts(sor, orgid)
except Exception as e:
debug(f'{e}')
if __name__ == '__main__':
run(OpenAccount)