test: handle dates properly
This commit is contained in:
@@ -16,7 +16,7 @@ repos:
|
|||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- flake8-bugbear
|
- flake8-bugbear
|
||||||
- flake8-comprehensions
|
- flake8-comprehensions
|
||||||
- flake8-simplify
|
- flake8-simplify==0.30.0
|
||||||
args: ['--config', '.github/helpers/.flake8_strict']
|
args: ['--config', '.github/helpers/.flake8_strict']
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
|
|||||||
@@ -88,12 +88,15 @@ def make_new_sla():
|
|||||||
|
|
||||||
def make_holiday_list():
|
def make_holiday_list():
|
||||||
if not frappe.db.exists("HD Service Holiday List", TEST_HOLIDAY_LIST_NAME):
|
if not frappe.db.exists("HD Service Holiday List", TEST_HOLIDAY_LIST_NAME):
|
||||||
|
# from_date = first date of current year
|
||||||
|
from_date = datetime(datetime.today().year, 1, 1).date()
|
||||||
|
to_date = datetime(datetime.today().year + 1, 1, 15).date()
|
||||||
frappe.get_doc(
|
frappe.get_doc(
|
||||||
{
|
{
|
||||||
"doctype": "HD Service Holiday List",
|
"doctype": "HD Service Holiday List",
|
||||||
"holiday_list_name": TEST_HOLIDAY_LIST_NAME,
|
"holiday_list_name": TEST_HOLIDAY_LIST_NAME,
|
||||||
"from_date": datetime.today().date(),
|
"from_date": from_date,
|
||||||
"to_date": (datetime.today() + timedelta(days=365)).date(),
|
"to_date": to_date,
|
||||||
}
|
}
|
||||||
).insert()
|
).insert()
|
||||||
|
|
||||||
@@ -207,3 +210,4 @@ def make_status(name: str = "Test Status", category: str = "Open"):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
return doc.insert(ignore_if_duplicate=True)
|
return doc.insert(ignore_if_duplicate=True)
|
||||||
|
return doc.insert(ignore_if_duplicate=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user