[WIP] Accounting Period Test cases
This commit is contained in:
parent
52571a80da
commit
caaebb9d2a
@ -7,4 +7,21 @@ import frappe
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestAccountingPeriod(unittest.TestCase):
|
class TestAccountingPeriod(unittest.TestCase):
|
||||||
|
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
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user