fix: fiscal year error

This commit is contained in:
casesolved-co-uk 2021-04-10 18:59:57 +00:00
parent 75ebfbdaf3
commit 68a31d3d0d

View File

@ -18,14 +18,11 @@ class TestTaxDetail(unittest.TestCase):
self.from_date = get_first_day(now)
self.to_date = get_last_day(now)
for fy in frappe.get_list('Fiscal Year', fields=('year', 'year_start_date', 'year_end_date')):
if now >= fy['year_start_date'] and now <= fy['year_end_date']:
break
else:
docs = [{
"abbr": "_T",
"company_name": "_T",
"country": "United Kingdom",
"default_currency": "GBP",
"doctype": "Company",
"name": "_T"
},{
"companies": [{
"company": "_T",
"parent": "_Test Fiscal",
@ -38,6 +35,15 @@ class TestTaxDetail(unittest.TestCase):
"year_start_date": get_year_start(now)
}] + docs
docs = [{
"abbr": "_T",
"company_name": "_T",
"country": "United Kingdom",
"default_currency": "GBP",
"doctype": "Company",
"name": "_T"
}] + docs
for doc in docs:
try:
db_doc = frappe.get_doc(doc)