Skip to content

Commit

Permalink
refactor(test): test cases modified to handle new approach
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Mar 20, 2024
1 parent a158b82 commit 8130957
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions erpnext/setup/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,10 @@ def get_random_date(start_date, start_range, end_range):
def create_transaction_deletion_record(company):
transaction_deletion_record = frappe.new_doc("Transaction Deletion Record")
transaction_deletion_record.company = company
transaction_deletion_record.process_in_single_transaction = True
transaction_deletion_record.save(ignore_permissions=True)
transaction_deletion_record.submit()
transaction_deletion_record.start_deletion_tasks()


def clear_masters():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_no_of_docs_is_correct(self):
for i in range(5):
create_task("Dunder Mifflin Paper Co")
tdr = create_transaction_deletion_doc("Dunder Mifflin Paper Co")
tdr.reload()
for doctype in tdr.doctypes:
if doctype.doctype_name == "Task":
self.assertEqual(doctype.no_of_docs, 5)
Expand Down Expand Up @@ -60,7 +61,9 @@ def create_company(company_name):
def create_transaction_deletion_doc(company):
tdr = frappe.get_doc({"doctype": "Transaction Deletion Record", "company": company})
tdr.insert()
tdr.process_in_single_transaction = True
tdr.submit()
tdr.start_deletion_tasks()
return tdr


Expand Down

0 comments on commit 8130957

Please sign in to comment.