Introduction
This package can be used by Odoo devs looking to test their integration/RPC code against a safe/sandbox live Odoo instance.
The runbot servers offer many such instances, which this module can access to find and return url, database and user credentials of some of these live instances.
Try to be light with your tests, do not abuse Odoo's runbot servers.
Below some basic usage examples, but do take a look at the code to see some other useful methods.
Usage
####1. Simple example, using default values:
from odoo_find_runbot_instance import get_runbot_url_db, runbot_admin_user_credentials
import httpx
url, db = get_runbot_url_db(httpx)
username, passwd = runbot_admin_user_credentials()
####2. Same, but for version 14 and enterprise branch:
from odoo_find_runbot_instance import get_runbot_url_db, runbot_admin_user_credentials
import httpx
url, db = get_runbot_url_db(httpx, version='14.0', branch='enterprise')
username, passwd = runbot_admin_user_credentials()
Pytest Usage
###conftest.py
import pytest
import httpx
from typing import Tuple
from odoo_find_runbot_instance import runbot_admin_user_credentials, get_runbot_url_db
@pytest.fixture(scope='package')
def url_db_user_pwd() -> Tuple[str, str, str, str]:
username, password = runbot_admin_user_credentials()
# if you prefer to use the demo user use the line below
# username, password = runbot_admin_user_credentials()
url, db = get_runbot_url_db(httpx)
return f"{url}/jsonrpc", db, username, password
test_example.py
import httpx
from aio_odoorpc import OdooRPC
def test_odoo(url_db_user_pwd: list):
url, db, user, pwd = url_db_user_pwd
with httpx.Client() as session:
odoo = OdooRPC(database=db,
username_or_uid=user,
password=pwd,
http_client=session,
url_jsonrpc_endpoint=url,
default_model_name='product.template')
odoo.login()
# you are all set...
products = odoo.search_read(domain=[], fields=['list_price'], limit=10)
...
Metadata
Release files for odoo-find-runbot-instance 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| odoo-find-runbot-instance-0.1.3.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| odoo_find_runbot_instance-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / odoo-find-runbot-instance-0.1.3.tar.gz
| Download URL | odoo-find-runbot-instance-0.1.3.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef02bdb2ca0bd123dac4167e3ae093caab94e7e77363bc1293b933a41d00c2d7
|
|
BLAKE2b-256 checksum How to use checksums |
786d0cad3fdeabf557214c3453f1d7c842da0de4c57776434ab34f60085f548e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.5 CPython/3.8.6 Linux/5.8.0-48-generic
|
Release files / odoo_find_runbot_instance-0.1.3-py3-none-any.whl
| Download URL | odoo_find_runbot_instance-0.1.3-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d8b5f888d00133944091df768f685d14335b507584a0aac53009624dd239411
|
|
BLAKE2b-256 checksum How to use checksums |
81d7877eba2e185666ae0b7dab39d2e52d4aa2ff1ad85c738470d153ccacb216
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.5 CPython/3.8.6 Linux/5.8.0-48-generic
|