From 405d1528c3d8dcff120003ffaacaf24d429c806a Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 2 Oct 2023 09:28:42 +0530 Subject: [PATCH] test: use fixtures for sales and purchase invoice (cherry picked from commit c322e5f38140b1fab8f940db542e25c2b122ab54) # Conflicts: # erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py --- .../accounts/doctype/sales_invoice/test_sales_invoice.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index e0a7ff002bb..55fecc560e3 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -6,8 +6,12 @@ import unittest import frappe from frappe.model.dynamic_links import get_dynamic_link_map +<<<<<<< HEAD from frappe.model.naming import make_autoname from frappe.tests.utils import change_settings +======= +from frappe.tests.utils import FrappeTestCase, change_settings +>>>>>>> c322e5f381 (test: use fixtures for sales and purchase invoice) from frappe.utils import add_days, flt, getdate, nowdate, today import erpnext @@ -38,7 +42,7 @@ from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import from erpnext.stock.utils import get_incoming_rate, get_stock_balance -class TestSalesInvoice(unittest.TestCase): +class TestSalesInvoice(FrappeTestCase): def setUp(self): from erpnext.stock.doctype.stock_ledger_entry.test_stock_ledger_entry import create_items @@ -46,6 +50,9 @@ class TestSalesInvoice(unittest.TestCase): create_internal_parties() setup_accounts() + def tearDown(self): + frappe.db.rollback() + def make(self): w = frappe.copy_doc(test_records[0]) w.is_pos = 0