refactor: use environment variables for Tryton credentials
This commit is contained in:
18
test_rpc.py
Normal file
18
test_rpc.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
from sabatron_tryton_rpc_client.client import Client
|
||||
import datetime
|
||||
|
||||
client = Client(
|
||||
hostname=os.environ.get("TRYTON_HOSTNAME", "localhost"),
|
||||
database=os.environ.get("TRYTON_DATABASE", "tryton"),
|
||||
username=os.environ.get("TRYTON_USERNAME", "admin"),
|
||||
password=os.environ.get("TRYTON_PASSWORD", ""),
|
||||
port=int(os.environ.get("TRYTON_PORT", 8000)),
|
||||
)
|
||||
|
||||
client.connect()
|
||||
|
||||
name = "model.party.party.read"
|
||||
args = ([1], ["id", "name", "code"], {})
|
||||
|
||||
client.call(name, args)
|
||||
Reference in New Issue
Block a user