[WIP] Accounting Period Test cases

This commit is contained in:
Gaurav Naik 2018-05-14 18:11:09 +05:30
parent 52571a80da
commit caaebb9d2a

View File

@ -7,4 +7,21 @@ import frappe
import unittest
class TestAccountingPeriod(unittest.TestCase):
pass
def test_overlap(self):
ap1 = create_accounting_period({"start_date":"2018-04-01", "end_date":"2018-06-30", "company":"Wind Power LLC"})
ap1.save()
ap2 = create_accounting_period({"start_date":"2018-06-30", "end_date":"2018-07-10", "company":"Wind Power LLC"})
self.assertRaises(frappe.OverlapError, accounting_period_2.save())
def tearDown(self):
pass
def create_accounting_period(**args):
accounting_period = frappe.new_doc("Accounting Period")
accounting_period.start_date = args.start_date or frappe.utils.datetime.date(2018, 4, 1)
accounting_period.end_date = args.end_date or frappe.utils.datetime.date(2018, 6, 30)
accounting_period.company = args.company
accounting_period.period_name = "_Test_Period_Name_1"
return accounting_period