[To FIX] Hackish fix to test, needs to be done properly as behaviour is now part of the call to report.

This commit is contained in:
Graeme Gellatly
2017-10-08 20:36:35 +13:00
parent 142cdfbb20
commit 57bd6a112e
2 changed files with 5 additions and 4 deletions

View File

@@ -41,14 +41,14 @@ class TestPrintingPrinter(TransactionCase):
# TODO: None here used as report - tests here should be merged # TODO: None here used as report - tests here should be merged
# with tests in test_printing_printer_tray from when modules merged # with tests in test_printing_printer_tray from when modules merged
self.assertEqual(self.Model.print_options( self.assertEqual(self.Model.print_options(
None, doc_format='raw'), {'raw': 'True',} None, doc_format='raw'), {'raw': 'True'}
) )
self.assertEqual(self.Model.print_options( self.assertEqual(self.Model.print_options(
None, doc_format='pdf', copies=2), {'copies': '2',} None, doc_format='pdf', copies=2), {'copies': '2'}
) )
self.assertEqual(self.Model.print_options( self.assertEqual(self.Model.print_options(
None, doc_format='raw', copies=2), None, doc_format='raw', copies=2),
{'raw': 'True', 'copies': '2',} {'raw': 'True', 'copies': '2'}
) )
@mock.patch('%s.cups' % server_model) @mock.patch('%s.cups' % server_model)

View File

@@ -90,7 +90,8 @@ class TestReport(HttpCase):
records = self.env[report.model].search([], limit=5) records = self.env[report.model].search([], limit=5)
document, doc_format = report.render_qweb_pdf(records.ids) document, doc_format = report.render_qweb_pdf(records.ids)
print_document.assert_called_once_with( print_document.assert_called_once_with(
report, document, report.report_type) report, document,
action='server', doc_format='qweb-pdf', tray=False)
def test_print_document_not_printable(self): def test_print_document_not_printable(self):
""" It should print the report, regardless of the defined behaviour """ """ It should print the report, regardless of the defined behaviour """