Skip to content

Commit

Permalink
Merge pull request #1554 from VoicuStefan2001/16.0-upd-deltatech_prod…
Browse files Browse the repository at this point in the history
…uct_list

[16.0][UPD] deltatech_product_list tests
  • Loading branch information
VoicuStefan2001 authored Jul 15, 2024
2 parents c11fdbf + 02bac9b commit 53a30c0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions deltatech_product_list/tests/__init__.py
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
29 changes: 29 additions & 0 deletions deltatech_product_list/tests/test_product_list.py
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)

0 comments on commit 53a30c0

Please sign in to comment.