summaryrefslogtreecommitdiff
path: root/addons/sale_coupon/tests/test_program_with_code_operations.py
diff options
context:
space:
mode:
authorJoseph Caburnay <jcb@odoo.com>2019-10-10 11:45:35 +0000
committerPierre Masereel <pim@odoo.com>2020-05-08 14:27:29 +0000
commitafad149eb8a542b39e9508a458d7aeb43aeb60ed (patch)
tree80b405cfb2d6050e848120a071ce2ed22c712932 /addons/sale_coupon/tests/test_program_with_code_operations.py
parentef05ca2812c3407dddd20921604661726c859d74 (diff)
[REF] *_sale_coupon: create coupon module
This refactoring extracts parts of `sale_coupon` module to create a more generic module called `coupon`. This new module can be extended in different sales modules to implement functionalities specific to modules that extend it.
Diffstat (limited to 'addons/sale_coupon/tests/test_program_with_code_operations.py')
-rw-r--r--addons/sale_coupon/tests/test_program_with_code_operations.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/sale_coupon/tests/test_program_with_code_operations.py b/addons/sale_coupon/tests/test_program_with_code_operations.py
index 92146c1d1f9..466eb9eabd2 100644
--- a/addons/sale_coupon/tests/test_program_with_code_operations.py
+++ b/addons/sale_coupon/tests/test_program_with_code_operations.py
@@ -18,7 +18,7 @@ class TestProgramWithCodeOperations(TestSaleCouponCommon):
# In this case, it will generate the coupon for every partner.
# Thus, we should ensure that if you leave the domain untouched, it generates a coupon for each partner
# as hinted on the screen ('Match all records (X records)')
- self.env['sale.coupon.generate'].with_context(active_id=self.code_promotion_program.id).create({
+ self.env['coupon.generate.wizard'].with_context(active_id=self.code_promotion_program.id).create({
'generation_type': 'nbr_customer',
}).generate_coupon()
self.assertEqual(len(self.code_promotion_program.coupon_ids), len(self.env['res.partner'].search([])), "It should have generated a coupon for every partner")
@@ -28,7 +28,7 @@ class TestProgramWithCodeOperations(TestSaleCouponCommon):
self.code_promotion_program.reward_type = 'discount'
- self.env['sale.coupon.generate'].with_context(active_id=self.code_promotion_program.id).create({
+ self.env['coupon.generate.wizard'].with_context(active_id=self.code_promotion_program.id).create({
'generation_type': 'nbr_customer',
'partners_domain': "[('id', 'in', [%s])]" % (self.steve.id),
}).generate_coupon()
@@ -69,7 +69,7 @@ class TestProgramWithCodeOperations(TestSaleCouponCommon):
def test_coupon_code_with_pricelist(self):
# Test case: Generate a coupon (10% discount) and apply it on an order with a specific pricelist (10% discount)
- self.env['sale.coupon.generate'].with_context(active_id=self.code_promotion_program_with_discount.id).create({
+ self.env['coupon.generate.wizard'].with_context(active_id=self.code_promotion_program_with_discount.id).create({
'generation_type': 'nbr_coupon',
'nbr_coupons': 1,
}).generate_coupon()
@@ -127,7 +127,7 @@ class TestProgramWithCodeOperations(TestSaleCouponCommon):
'promo_code': 'free_B_on_next_order',
})
# 2.
- self.p1 = self.env['sale.coupon.program'].create({
+ self.p1 = self.env['coupon.program'].create({
'name': 'Code for 10% on next order',
'discount_type': 'percentage',
'discount_percentage': 10.0,