Find and return url, database and user credentials of a live Odoo instance running on the runbot
Project description
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)
...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file odoo-find-runbot-instance-0.1.3.tar.gz
.
File metadata
- Download URL: odoo-find-runbot-instance-0.1.3.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.8.6 Linux/5.8.0-48-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef02bdb2ca0bd123dac4167e3ae093caab94e7e77363bc1293b933a41d00c2d7 |
|
MD5 | 29924dc76b89f95263472fa7be9c068a |
|
BLAKE2b-256 | 786d0cad3fdeabf557214c3453f1d7c842da0de4c57776434ab34f60085f548e |
File details
Details for the file odoo_find_runbot_instance-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: odoo_find_runbot_instance-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.8.6 Linux/5.8.0-48-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d8b5f888d00133944091df768f685d14335b507584a0aac53009624dd239411 |
|
MD5 | 1775b56b217d233c5433160ea4a6705a |
|
BLAKE2b-256 | 81d7877eba2e185666ae0b7dab39d2e52d4aa2ff1ad85c738470d153ccacb216 |