Initial commit
This commit is contained in:
1
garazd_product_label/tests/__init__.py
Normal file
1
garazd_product_label/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_print_product_label
|
||||
31
garazd_product_label/tests/test_print_product_label.py
Normal file
31
garazd_product_label/tests/test_print_product_label.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from odoo.tests.common import TransactionCase
|
||||
from odoo.tools import test_reports
|
||||
from odoo.tests import tagged
|
||||
|
||||
|
||||
@tagged('post_install', '-at_install', 'garazd_product_label')
|
||||
class TestPrintProductLabel(TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestPrintProductLabel, self).setUp()
|
||||
self.product_chair = self.env.ref('product.product_product_12')
|
||||
self.product_drawer = self.env.ref('product.product_product_27')
|
||||
|
||||
def test_print_wizard(self):
|
||||
ctx = {
|
||||
'active_model': 'product.product',
|
||||
'default_product_product_ids': [
|
||||
self.product_chair.id,
|
||||
self.product_drawer.id,
|
||||
],
|
||||
}
|
||||
wizard = self.env['print.product.label'].with_context(**ctx).create({})
|
||||
self.assertEqual(len(wizard.label_ids), 2)
|
||||
|
||||
test_reports.try_report(
|
||||
self.env.cr,
|
||||
self.env.uid,
|
||||
'garazd_product_label.report_product_label_57x35_template',
|
||||
ids=wizard.label_ids.ids,
|
||||
our_module='garazd_product_label'
|
||||
)
|
||||
Reference in New Issue
Block a user