From ffb173d1fb74f806dc76f35b39127ad9e8c63a0a Mon Sep 17 00:00:00 2001 From: Tyler Matteson Date: Mon, 13 May 2024 12:25:23 -0400 Subject: [PATCH] wip: version-15 --- inventory_tools/tests/conftest.py | 6 ++++-- inventory_tools/tests/setup.py | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/inventory_tools/tests/conftest.py b/inventory_tools/tests/conftest.py index 186e3a1..23facc9 100644 --- a/inventory_tools/tests/conftest.py +++ b/inventory_tools/tests/conftest.py @@ -1,5 +1,6 @@ from pathlib import Path from unittest.mock import MagicMock +import json import frappe import pytest @@ -32,10 +33,11 @@ def db_instance(): currentsite = "test_site" sites = Path(get_bench_path()) / "sites" - if (sites / "currentsite.txt").is_file(): - currentsite = (sites / "currentsite.txt").read_text() + if (sites / "common_site_config.json").is_file(): + currentsite = json.loads((sites / "common_site_config.json").read_text()).get("default_site") frappe.init(site=currentsite, sites_path=sites) frappe.connect() frappe.db.commit = MagicMock() yield frappe.db + diff --git a/inventory_tools/tests/setup.py b/inventory_tools/tests/setup.py index f7dc0f2..2bc71c9 100644 --- a/inventory_tools/tests/setup.py +++ b/inventory_tools/tests/setup.py @@ -617,12 +617,12 @@ def create_production_plan(settings, prod_plan_from_doc): wo.wip_warehouse = "Kitchen - APC" wo.save() wo.submit() - job_cards = frappe.get_all("Job Card", {"work_order": wo.name}) - for job_card in job_cards: - job_card = frappe.get_doc("Job Card", job_card) - job_card.time_logs[0].completed_qty = wo.qty - job_card.save() - job_card.submit() + # job_cards = frappe.get_all("Job Card", {"work_order": wo.name}) + # for job_card in job_cards: + # job_card = frappe.get_doc("Job Card", job_card) + # job_card.time_logs[0].completed_qty = wo.qty + # job_card.save() + # job_card.submit() def create_fruit_material_request(settings):