Skip to content

Commit

Permalink
Simple implementation of subscription trial period
Browse files Browse the repository at this point in the history
  • Loading branch information
tarteo committed Mar 26, 2024
1 parent bac5452 commit 082fdd1
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion argocd_sale/tests/test_free_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,25 @@ def test_next_payment_date(self):
sub.generate_invoice()
sub._invoice_paid_hook()
self.assertEqual(
sub.invoice_ids[0].amount_untaxed,
sub.invoice_ids[0].amount_untaxed, # It's order newest to oldest
30.0,
"Next invoice should be the normal price",
)

sub2 = self.env["sale.subscription"].create(
{
"template_id": sub_tmpl.id,
"sale_subscription_line_ids": [
Command.create({"product_id": sub_product.id})
],
"partner_id": partner_id.id,
"pricelist_id": partner_id.property_product_pricelist.id,
}
)
sub2.generate_invoice()
sub2._invoice_paid_hook()
self.assertEqual(
sub2.invoice_ids.amount_untaxed,
30.0,
"Invoice of new second subscription must be the normal price",
)

0 comments on commit 082fdd1

Please sign in to comment.