Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: made transaction rollback true
Browse files Browse the repository at this point in the history
  • Loading branch information
zubair-ce07 committed Sep 21, 2023
1 parent d8da737 commit 3fee834
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ecommerce/coupons/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
@ddt.ddt
class CouponUtilsTests(TestCase, CouponMixin, DiscoveryMockMixin):

serialized_rollback = True

def setUp(self):
"""
Setup variables for test cases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ def setUp(self):
type='Absolute',
value=47,
)



for i in range(2):
code = '{}EntUserPercentBenefit'.format(i)
voucher = VoucherFactory(code=code)
name = 'My voucher{}'.format(i)
voucher = VoucherFactory(code=code, name=name)
offer_name = "Coupon [{}]-{}-{}".format(
voucher.pk,
benefit_percent.type,
Expand All @@ -69,7 +71,8 @@ def setUp(self):

for i in range(2):
code = '{}EntUserAbsoluteBenefit'.format(i)
voucher = VoucherFactory(code=code)
name = 'My voucher{}'.format(i)
voucher = VoucherFactory(code=code, name=name)
offer_name = "Coupon [{}]-{}-{}".format(
voucher.pk,
benefit_absolute.type,
Expand All @@ -93,7 +96,8 @@ def setUp(self):

for i in range(3):
code = '{}NoEntUserPercentBenefit'.format(i)
voucher = VoucherFactory(code=code)
name = 'My voucher{}'.format(i)
voucher = VoucherFactory(code=code, name=name)
offer_name = "Coupon [{}]-{}-{}".format(
voucher.pk,
benefit.type,
Expand Down
3 changes: 2 additions & 1 deletion ecommerce/extensions/api/v2/tests/views/test_coupons.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def test_clean_voucher_request_data_notify_email_validation_msg(self):

def test_creating_multi_offer_coupon(self):
"""Test the creation of a multi-offer coupon."""
ordinary_coupon = self.create_coupon(quantity=2)

ordinary_coupon = self.create_coupon(quantity=2, title='Test offer coupon')
ordinary_coupon_vouchers = ordinary_coupon.attr.coupon_vouchers.vouchers.all()
self.assertEqual(
ordinary_coupon_vouchers[0].offers.first(),
Expand Down

0 comments on commit 3fee834

Please sign in to comment.