summaryrefslogtreecommitdiff
path: root/tests/test_program_rewards.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-09-26 20:02:37 +0200
committerChristophe Simonis <chs@odoo.com>2018-09-26 20:02:37 +0200
commita17ddde9a1c6d5dfdac4a3dd7c1f6625e27ca2c6 (patch)
treed859784678f644aa007220c9b4c89749cd206b2d /tests/test_program_rewards.py
parent8801177bf172d42eb37bfb67c7d1421697bd4f03 (diff)
parent6b5aadc7ce95282ae4bcca996d2e15efc89d8f6b (diff)
[MERGE] forward port branch 11.0 up to 1e8ab568c1f
Diffstat (limited to 'tests/test_program_rewards.py')
-rw-r--r--tests/test_program_rewards.py63
1 files changed, 0 insertions, 63 deletions
diff --git a/tests/test_program_rewards.py b/tests/test_program_rewards.py
deleted file mode 100644
index 057e47ada77..00000000000
--- a/tests/test_program_rewards.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-from openerp.addons.sale_coupon.tests.common import TestSaleCouponCommon
-
-class TestSaleCouponProgramRules(TestSaleCouponCommon):
- # Test all the kind of reward a customer can receive.
- # The product reward is already tested in the basic operations test
-
- def test_program_rewards(self):
- # Test case: Based on the partners domain
-
- self.immediate_promotion_program.write({'reward_type': "discount"})
-
- order = self.empty_order
- order.write({'order_line': [
- (0, False, {
- 'product_id': self.product_A.id,
- 'name': '1 Product A',
- 'product_uom': self.uom_unit.id,
- 'product_uom_qty': 1.0,
- }),
- (0, False, {
- 'product_id': self.product_B.id,
- 'name': '2 Product B',
- 'product_uom': self.uom_unit.id,
- 'product_uom_qty': 1.0,
- })
- ]})
- order.recompute_coupon_lines()
- self.assertEqual(len(order.order_line.ids), 3, "The promo offert should have been applied as the partner is correct, the discount is not created")
-
-
- def test_program_rewards_discount(self):
-
- # Test case 1: 1% discount on total order
- program = self.env['sale.coupon.program'].create({
- 'name': 'Buy at least 1000 EUR, ',
- 'rule_minimum_amount': 1000.0,
- 'promo_code_usage': 'no_code_needed',
- 'reward_type': 'discount',
- 'discount_type': 'percentage',
- 'discount_percentage': 1.0,
- 'discount_apply_on': 'on_order',
- 'active': True,
- })
- order = self.env['sale.order'].create({
- 'partner_id': self.steve.id
- })
- self.env['sale.order.line'].create({
- 'product_id': self.product_A.id,
- 'name': '1 Product A',
- 'product_uom': self.uom_unit.id,
- 'product_uom_qty': 11.0,
- 'order_id': order.id,
- })
- self.env['sale.order.line'].create({
- 'product_id': self.product_B.id,
- 'name': '2 Product B',
- 'product_uom': self.uom_unit.id,
- 'product_uom_qty': 1.0,
- 'order_id': order.id,
- })