-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1554 from VoicuStefan2001/16.0-upd-deltatech_prod…
…uct_list [16.0][UPD] deltatech_product_list tests
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# © 2008-2021 Deltatech | ||
# Dorin Hongu <dhongu(@)gmail(.)com | ||
# See README.rst file on addons root folder for license details | ||
from . import test_product_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# © 2008-2021 Deltatech | ||
# Dorin Hongu <dhongu(@)gmail(.)com | ||
# See README.rst file on addons root folder for license details | ||
import json | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestProductList(TransactionCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.company = self.env.ref("base.main_company") | ||
self.product_list = self.env["product.list"].create( | ||
{ | ||
"name": "Test Product List", | ||
"products_domain": json.dumps([["sale_ok", "=", True]]), | ||
"active": True, | ||
"limit": 80, | ||
"company_id": self.company.id, | ||
} | ||
) | ||
|
||
def test_product_list_creation(self): | ||
self.assertEqual(self.product_list.name, "Test Product List") | ||
self.assertEqual(json.loads(self.product_list.products_domain), [["sale_ok", "=", True]]) | ||
self.assertTrue(self.product_list.active) | ||
self.assertEqual(self.product_list.limit, 80) | ||
self.assertEqual(self.product_list.company_id, self.company) |