Skip to content

Commit

Permalink
tests: test cadence (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
agritheory authored and HKuz committed Aug 23, 2023
1 parent 370dd6f commit 6b5bd47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def create_warehouse_path_custom_field(self):

@frappe.whitelist()
def create_inventory_tools_settings(doc, method=None) -> None:
if frappe.db.exists("Inventory Tools Settings", {"company": doc.name}):
if not frappe.db.exists("Company", doc.name) or frappe.db.exists(
"Inventory Tools Settings", {"company": doc.name}
):
return
its = frappe.new_doc("Inventory Tools Settings")
its.company = doc.name
Expand Down
4 changes: 1 addition & 3 deletions inventory_tools/tests/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ def before_test():
"bank_account": "Primary Checking",
}
)
enable_all_roles_and_domains()
set_defaults_for_tests()
frappe.db.commit()
create_test_data()
for modu in frappe.get_all("Module Onboarding"):
frappe.db.set_value("Module Onboarding", modu, "is_complete", 1)
frappe.set_value("Website Settings", "Website Settings", "home_page", "login")
frappe.db.commit()
create_test_data()


def create_test_data():
Expand Down

0 comments on commit 6b5bd47

Please sign in to comment.