def test_after_import_invoice_create_moves(self):
        """ It should create accounting moves for newly paid invoices """
        with mock.patch.multiple(
            self.unit, binder_for=mock.DEFAULT, unit_for=mock.DEFAULT,
            session=mock.DEFAULT, _get_binding=mock.DEFAULT,
        ):
            invoice_id = self.unit._get_binding().invoice_id
            self.unit.unit_for()._get_order_line_count.return_value = 1
            invoice_id.invoice_line_ids = [True]
            self.unit.env.ref().invoice_state = 'paid'
            invoice_id.action_move_create.side_effect = EndTestException
            with self.assertRaises(EndTestException):
                self.unit._after_import(self.record)