mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[WIP] Migrate base_report_to_printer to V12
This commit is contained in:
committed by
David Montull
parent
dbb332b204
commit
2dfca7adeb
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 LasLabs Inc.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 LasLabs Inc.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class TestPrintingPrinter(TransactionCase):
|
||||
'location': 'Location',
|
||||
'uri': 'URI',
|
||||
}
|
||||
self.report = self.env['ir.actions.report'].search([], limit=1)
|
||||
|
||||
def new_record(self):
|
||||
return self.Model.create(self.printer_vals)
|
||||
@@ -66,7 +67,6 @@ class TestPrintingPrinter(TransactionCase):
|
||||
|
||||
def test_print_options(self):
|
||||
""" It should generate the right options dictionnary """
|
||||
'copies': '2',
|
||||
# TODO: None here used as report - tests here should be merged
|
||||
# with tests in test_printing_printer_tray from when modules merged
|
||||
report = self.env['ir.actions.report'].search([], limit=1)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 LasLabs Inc.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
@@ -165,7 +164,6 @@ class TestPrintingPrinter(TransactionCase):
|
||||
self, os_unlink, cups):
|
||||
"""
|
||||
When a ENOENT error is encountered, the file has already been unlinked
|
||||
|
||||
This is not an issue, as we were trying to delete the file.
|
||||
The update can continue.
|
||||
"""
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 LasLabs Inc.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
@@ -26,6 +25,7 @@ class TestPrintingPrinterWizard(TransactionCase):
|
||||
'printer-make-and-model': 'Make and Model',
|
||||
'printer-location': "location",
|
||||
'device-uri': 'URI',
|
||||
'printer-uri-supported': 'uri'
|
||||
}
|
||||
|
||||
def _record_vals(self, sys_name='sys_name'):
|
||||
@@ -52,6 +52,7 @@ class TestPrintingPrinterWizard(TransactionCase):
|
||||
cups.Connection().getPrinters.return_value = {
|
||||
'sys_name': self.printer_vals,
|
||||
}
|
||||
cups.Connection().getPPD3.return_value = (200, 0, '')
|
||||
self.Model.action_ok()
|
||||
cups.Connection().getPrinters.assert_called_once_with()
|
||||
|
||||
@@ -68,6 +69,7 @@ class TestPrintingPrinterWizard(TransactionCase):
|
||||
cups.Connection().getPrinters.return_value = {
|
||||
'sys_name': self.printer_vals,
|
||||
}
|
||||
cups.Connection().getPPD3.return_value = (200, 0, '')
|
||||
self.Model.action_ok()
|
||||
rec_id = self.env['printing.printer'].search([
|
||||
('system_name', '=', 'sys_name')
|
||||
@@ -89,6 +91,7 @@ class TestPrintingPrinterWizard(TransactionCase):
|
||||
cups.Connection().getPrinters.return_value = {
|
||||
'sys_name': self.printer_vals,
|
||||
}
|
||||
cups.Connection().getPPD3.return_value = (200, 0, '')
|
||||
self.env['printing.printer'].create(
|
||||
self._record_vals()
|
||||
)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 SYLEAM
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
@@ -47,12 +46,14 @@ class TestPrintingReportXmlAction(TransactionCase):
|
||||
self.assertEqual(xml_action.behaviour(), {
|
||||
'action': xml_action.action,
|
||||
'printer': xml_action.printer_id,
|
||||
'tray': False,
|
||||
})
|
||||
|
||||
xml_action = self.new_record({'printer_id': self.new_printer().id})
|
||||
self.assertEqual(xml_action.behaviour(), {
|
||||
'action': xml_action.action,
|
||||
'printer': xml_action.printer_id,
|
||||
'tray': False,
|
||||
})
|
||||
|
||||
self.assertEqual(self.Model.behaviour(), {})
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 LasLabs Inc.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 LasLabs Inc.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 LasLabs Inc.
|
||||
# Copyright 2017 Tecnativa - Jairo Llopis
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 LasLabs Inc.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user