Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Unit Tests in Odoo

Odebírat

Get notified when there's activity on this post

This question has been flagged
unitsqaunittest
2 Odpovědi
9305 Zobrazení
Avatar
thushfdo

As a QA person, i need to learn about unit testing in Odoo. My idea is to find the areas we need to do unit testing and how to isolate certain codes to perform testing. Please suggest me a good reference or a doc where i can find these info. 

We have simple guideline as below
Step 01 : Learn and Identify what to test in Unit Testing (in the technology)
Step 02 : How to isolate the particular "Code"
Step 03 : Learn How to write a unit testing for Step 02

Stuck in step 01 and 02 for version 13, 14 and 15

0
Avatar
Zrušit
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

Hi,
Test Cases In Odoo Python

  • Testing of our module function gives the desired output
  • Executing test for fixing the bugs
  • It is the self-testing by the developers itself to check whether the module meets the requirements of the client
  • Use for the Quality assurance of the module
  • Unit Testing - Testing a unit of the module ie a function in the module

Format For The Test Case In Odoo

  •  Need to create a directory named “tests”
  • Inside that create __init__.py file and python files.
  • The format name of the Python file should be “test_file_name.py”

 Example
     
Class TestModel(common.TransactionCase):
def test_action(self):
record = self.env[‘model.name’].create({‘field’:’value’})
record.action()
self.assertEqual(record.field,expected_field_value)

  • Unit Testing will use the model “TransactionCase”
  • In this model, the function will be run manually from top to bottom automatically.
  • And the function needs to start with “test_”
  • The records created by using the test will not be stored in our database

To Run Test
 ./odoo-bin -i module_name –test-enable -c odoo.conf
Python3.8 odoo-bin -c odoo.conf –test-tags path_of_custom_module
NOTE: The above are just the basic of the test case in python
For more please refer the below blogs and documentations

How to Write Test Case in the Odoo 16 ERP

Testing Odoo — Odoo 16.0 documentation

Chapter 12.1 Python Testing - Test Cases | Odoo 15

How to Write Test Case in the Odoo 15 ERP

Hope it helps

0
Avatar
Zrušit
Avatar
Paresh Wagh
Nejlepší odpověď

You may find this section of the documentation useful:  Advanced E: Python Unit Tests — Odoo 15.0 documentation

0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
How to inherit fields_view_get() method when using Form in unittest
unittest
Avatar
0
říj 23
1886
How to make a field visible with optional="hide" when using Form in unittest
unittest
Avatar
0
říj 23
3093
unit test cases for wizard in odoo 10
unittest
Avatar
0
lis 20
3603
Is it safe to use assertEqual()? When I try self.assertIs(self.board, wi.board_id) I get AssertionError. (but self.assertEqual() works) Vyřešeno
unittest
Avatar
Avatar
1
kvě 17
6341
Is it possible to modify/patch an existing unittest in a custom module?
unittest v14
Avatar
Avatar
2
říj 23
3407
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now