'In order to test the Point of Sale in module, I will do a full flow from the sale to the payment and invoicing.
I will use two products, one with price including a 10% tax, the other one with 5% tax excluded from the price.'

def test_order_to_payment(self):

    self.pos_config.open_session_cb()
    self.pos_order_pos0 = self.PosOrder.create({'company_id': self.company_id, 'pricelist_id': self.partner1.property_product_pricelist.id, 'partner_id': self.partner1.id, 'lines': [(0, 0, {'name': 'OL/0001', 'product_id': self.product3.id, 'price_unit': 450, 'discount': 0.0, 'qty': 2.0, 'tax_ids': [(6, 0, self.product3.taxes_id.ids)]}), (0, 0, {'name': 'OL/0002', 'product_id': self.product4.id, 'price_unit': 300, 'discount': 0.0, 'qty': 3.0, 'tax_ids': [(6, 0, self.product4.taxes_id.ids)]})]})
    self.assertLess(abs((self.pos_order_pos0.amount_total - ((450 * 2) + ((300 * 3) * 1.05)))), 0.01, 'The    order    has    a    wrong    amount,    tax    included.')
    self.assertLess(abs((self.pos_order_pos0.amount_tax - ((900 - ((450 * 2) / 1.1)) + ((300 * 0.05) * 3)))), 0.01, 'The    order    has    a    wrong    tax    amount.')
    self.pos_discount_0 = self.env['pos.discount'].create({'discount': 5.0})
    context = {'active_model': 'pos.order', 'active_ids': [self.pos_order_pos0.id], 'active_id': self.pos_order_pos0.id}
    self.pos_discount_0.with_context(context).apply_discount()
    self.assertLess(abs((self.pos_order_pos0.amount_total - (((450 * 2) + ((300 * 3) * 1.05)) * 0.95))), 0.01, 'The    order    has    a    wrong    total    including    tax    and    discounts')
    context_make_payment = {'active_ids': [self.pos_order_pos0.id], 'active_id': self.pos_order_pos0.id}
    self.pos_make_payment_0 = self.PosMakePayment.with_context(context_make_payment).create({'amount': 100.0})
    context_payment = {'active_id': self.pos_order_pos0.id}
    self.pos_make_payment_0.with_context(context_payment).check()
    self.assertEqual(self.pos_order_pos0.state, 'draft', 'Order    should    be    in    draft    state.')
    defs = self.pos_make_payment_0.with_context({'active_id': self.pos_order_pos0.id}).default_get(['amount'])
    self.assertLess(abs((defs['amount'] - ((((450 * 2) + ((300 * 3) * 1.05)) * 0.95) - 100.0))), 0.01, 'The    remaining    balance    is    incorrect.')
    context_make_payment = {'active_ids': [self.pos_order_pos0.id], 'active_id': self.pos_order_pos0.id}
    self.pos_make_payment_1 = self.PosMakePayment.with_context(context_make_payment).create({'amount': ((((450 * 2) + ((300 * 3) * 1.05)) * 0.95) - 100.0)})
    self.pos_make_payment_1.with_context(context_make_payment).check()
    self.assertEqual(self.pos_order_pos0.state, 'paid', 'Order    should    be    in    paid    state.')
    self.pos_order_pos0._create_account_move_line()
    self.assertTrue(self.pos_order_pos0.account_move, 'Journal    entry    has    not    been    attached    to    Pos    order.')
