Revert "refactor: Remove redundant code"
This reverts commit 2773313dcb.
Because the changes would have resulted in other test failure... not
worth it.
This commit is contained in:
parent
7ce8a9e498
commit
c1dddc17da
1 changed files with 26 additions and 12 deletions
|
|
@ -33,19 +33,33 @@ def create_if_not_exists(doc):
|
|||
|
||||
@frappe.whitelist()
|
||||
def create_todo_records():
|
||||
frappe.db.sql("DELETE FROM `tabToDo` WHERE name!=''")
|
||||
|
||||
for number in range(1, 5):
|
||||
frappe.get_doc({
|
||||
"doctype": "ToDo",
|
||||
"date": add_to_date(now(), days=3),
|
||||
"description": "this is {} todo".format(number)
|
||||
}).insert()
|
||||
if frappe.db.get_all('ToDo', {'description': 'this is first todo'}):
|
||||
return
|
||||
|
||||
frappe.get_doc({
|
||||
"doctype": "ToDo",
|
||||
"date": add_to_date(now(), days=3),
|
||||
"description": "this is first todo"
|
||||
}).insert()
|
||||
frappe.get_doc({
|
||||
"doctype": "ToDo",
|
||||
"date": add_to_date(now(), days=-3),
|
||||
"description": "this is second todo"
|
||||
}).insert()
|
||||
frappe.get_doc({
|
||||
"doctype": "ToDo",
|
||||
"date": add_to_date(now(), months=2),
|
||||
"description": "this is third todo"
|
||||
}).insert()
|
||||
frappe.get_doc({
|
||||
"doctype": "ToDo",
|
||||
"date": add_to_date(now(), months=-2),
|
||||
"description": "this is fourth todo"
|
||||
}).insert()
|
||||
|
||||
@frappe.whitelist()
|
||||
def setup_workflow():
|
||||
from frappe.workflow.doctype.workflow.test_workflow import create_todo_workflow
|
||||
create_todo_workflow()
|
||||
create_todo_records()
|
||||
frappe.clear_cache()
|
||||
from frappe.workflow.doctype.workflow.test_workflow import create_todo_workflow
|
||||
create_todo_workflow()
|
||||
create_todo_records()
|
||||
frappe.clear_cache()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue