fix: use correct fiscal year function in testing
This commit is contained in:
parent
cf5b57bfac
commit
6998786055
@ -10,6 +10,7 @@ from .tax_detail import filter_match, save_custom_report
|
|||||||
|
|
||||||
class TestTaxDetail(unittest.TestCase):
|
class TestTaxDetail(unittest.TestCase):
|
||||||
def load_testdocs(self):
|
def load_testdocs(self):
|
||||||
|
from erpnext.accounts.utils import get_fiscal_year, FiscalYearError
|
||||||
datapath, _ = os.path.splitext(os.path.realpath(__file__))
|
datapath, _ = os.path.splitext(os.path.realpath(__file__))
|
||||||
with open(datapath + '.json', 'r') as fp:
|
with open(datapath + '.json', 'r') as fp:
|
||||||
docs = json.load(fp)
|
docs = json.load(fp)
|
||||||
@ -18,10 +19,9 @@ class TestTaxDetail(unittest.TestCase):
|
|||||||
self.from_date = get_first_day(now)
|
self.from_date = get_first_day(now)
|
||||||
self.to_date = get_last_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')):
|
try:
|
||||||
if now >= fy['year_start_date'] and now <= fy['year_end_date']:
|
get_fiscal_year(now, company="_T")
|
||||||
break
|
except FiscalYearError:
|
||||||
else:
|
|
||||||
docs = [{
|
docs = [{
|
||||||
"companies": [{
|
"companies": [{
|
||||||
"company": "_T",
|
"company": "_T",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user