From 5d976ca3acf18a6161954dc606f2b348a2d3033b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 30 Jan 2014 15:12:39 +0530 Subject: [PATCH] recurring invoice test fix --- accounts/doctype/sales_invoice/test_sales_invoice.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/accounts/doctype/sales_invoice/test_sales_invoice.py b/accounts/doctype/sales_invoice/test_sales_invoice.py index e98dfdc2a0..ccb7d532a5 100644 --- a/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -654,7 +654,8 @@ class TestSalesInvoice(unittest.TestCase): def _test_recurring_invoice(self, base_si, first_and_last_day): from webnotes.utils import add_months, get_last_day - from accounts.doctype.sales_invoice.sales_invoice import manage_recurring_invoices + from accounts.doctype.sales_invoice.sales_invoice \ + import manage_recurring_invoices, get_next_date no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_si.doc.recurring_type] @@ -662,7 +663,8 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(i+1, webnotes.conn.sql("""select count(*) from `tabSales Invoice` where recurring_id=%s and docstatus=1""", base_si.doc.recurring_id)[0][0]) - next_date = add_months(base_si.doc.posting_date, no_of_months) + next_date = get_next_date(base_si.doc.posting_date, no_of_months, + base_si.doc.repeat_on_day_of_month) manage_recurring_invoices(next_date=next_date, commit=False)