mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[IMP] Add a test mode to print a label on write
This commit is contained in:
committed by
duongtq
parent
66c3d88353
commit
fb571d406d
@@ -1,4 +1,5 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
import mock
|
||||
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
@@ -38,6 +39,15 @@ class TestWizardPrintRecordLabel(TransactionCase):
|
||||
record = Obj.search([], limit=1, order='id desc')
|
||||
self.assertEqual(res, record)
|
||||
|
||||
@mock.patch('%s.cups' % model)
|
||||
def test_print_label_test(self, cups):
|
||||
""" Check if print test """
|
||||
self.label.test_print_mode = True
|
||||
self.label.printer_id = self.printer
|
||||
self.label.record_id = 10
|
||||
self.label.print_test_label()
|
||||
cups.Connection().printFile.assert_called_once()
|
||||
|
||||
def test_emulation_without_params(self):
|
||||
""" Check if not execute next if not in this mode """
|
||||
self.label.test_labelary_mode = False
|
||||
|
||||
Reference in New Issue
Block a user