[IMP] base_report_to_printer: archive printers

This commit is contained in:
Jaime Arroyo
2020-10-06 17:32:01 +02:00
committed by John Herholz
parent 74018a0935
commit 27b944ae03
28 changed files with 47 additions and 5 deletions

View File

@@ -89,6 +89,18 @@ class TestPrintingServer(TransactionCase):
self.Model.action_update_printers()
self.assertEqual("unavailable", rec_id.status)
@mock.patch("%s.cups" % model)
def test_update_archived_printers(self, cups):
""" It should update status even if printer is archived """
rec_id = self.new_printer()
rec_id.toggle_active()
self.server.refresh()
cups.Connection().getPrinters().get.return_value = False
self.Model.action_update_printers()
self.assertEqual(
"unavailable", rec_id.status,
)
@mock.patch("%s.cups" % model)
def test_update_jobs_cron(self, cups):
""" It should get all jobs from CUPS server """