Debian Codegraph @

addons/pos_loyalty/tests/test_unlink_reward.py

raw symbols SCIP
1 # Part of Odoo. See LICENSE file for full copyright and licensing details.
2
3 from odoo.addons.pos_loyalty.tests.common import CommonPosLoyaltyTest
4 from odoo.tests.common import tagged
5
6
7 @tagged('-at_install', 'post_install')
8 class TestUnlinkReward(CommonPosLoyaltyTest):
9 def test_pos_unlink_reward(self):
10 self.create_backend_pos_order({
11 'order_data': {
12 'partner_id': self.partner_lowe.id,
13 'pricelist_id': self.partner_lowe.property_product_pricelist.id,
14 },
15 'line_data': [{
16 'qty': 5,
17 'product_id': self.twenty_dollars_no_tax.product_variant_id.id,
18 'reward_id': self.twenty_dollars_reward.id,
19 }],
20 })
21 # Ensure the reward is archived and not deleted
22 self.twenty_dollars_reward.unlink()
23 self.assertTrue(self.twenty_dollars_reward.exists())
24 self.assertFalse(self.twenty_dollars_reward.active)