mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
refactor: test for force-fetch on future subscription
This commit is contained in:
@@ -521,6 +521,18 @@ class TestSubscription(FrappeTestCase):
|
|||||||
subscription.process(posting_date="2023-01-22")
|
subscription.process(posting_date="2023-01-22")
|
||||||
self.assertEqual(len(subscription.invoices), 2)
|
self.assertEqual(len(subscription.invoices), 2)
|
||||||
|
|
||||||
|
def test_future_subscription(self):
|
||||||
|
"""Force-Fetch should not process future subscriptions"""
|
||||||
|
subscription = create_subscription(
|
||||||
|
start_date=add_months(nowdate(), 1),
|
||||||
|
submit_invoice=0,
|
||||||
|
generate_new_invoices_past_due_date=1,
|
||||||
|
party="_Test Subscription Customer John Doe",
|
||||||
|
)
|
||||||
|
subscription.force_fetch_subscription_updates()
|
||||||
|
subscription.reload()
|
||||||
|
self.assertEqual(len(subscription.invoices), 0)
|
||||||
|
|
||||||
|
|
||||||
def make_plans():
|
def make_plans():
|
||||||
create_plan(plan_name="_Test Plan Name", cost=900, currency="INR")
|
create_plan(plan_name="_Test Plan Name", cost=900, currency="INR")
|
||||||
|
|||||||
Reference in New Issue
Block a user