def test_import_invoice_lines_for_procurement_imports(self):
        """ It should run importer on records """
        with mock.patch.object(self.unit, 'unit_for') as mk:
            expect = mock.MagicMock()
            adapter = mock.MagicMock()
            adapter.search.return_value = [True]
            mk.side_effect = [adapter, expect]
            expect.run.side_effect = EndTestException
            with self.assertRaises(EndTestException):
                self.unit._import_invoice_lines_for_procurement(True)
            expect.run.assert_called_once_with(
                adapter.search()[0]
            )