refactor: add bare unit test cases

mainly for LLMs to catch up with the convention
This commit is contained in:
David
2024-10-06 11:56:22 +02:00
parent bda415a83d
commit 2adb417408
85 changed files with 850 additions and 85 deletions

View File

@@ -5,7 +5,7 @@
import json
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import make_test_records
from frappe.utils import flt
@@ -23,6 +23,15 @@ test_dependencies = ["Payment Term", "Payment Terms Template"]
test_records = frappe.get_test_records("Customer")
class UnitTestCustomer(UnitTestCase):
"""
Unit tests for Customer.
Use this class for testing individual functions and methods.
"""
pass
class TestCustomer(IntegrationTestCase):
def setUp(self):
if not frappe.get_value("Item", "_Test Item"):

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.controllers.queries import item_query
@@ -18,6 +18,15 @@ def create_party_specific_item(**args):
psi.insert()
class UnitTestPartySpecificItem(UnitTestCase):
"""
Unit tests for PartySpecificItem.
Use this class for testing individual functions and methods.
"""
pass
class TestPartySpecificItem(IntegrationTestCase):
def setUp(self):
self.customer = frappe.get_last_doc("Customer")

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, add_months, flt, getdate, nowdate
from erpnext.controllers.accounts_controller import InvalidQtyError
@@ -10,6 +10,15 @@ from erpnext.controllers.accounts_controller import InvalidQtyError
test_dependencies = ["Product Bundle"]
class UnitTestQuotation(UnitTestCase):
"""
Unit tests for Quotation.
Use this class for testing individual functions and methods.
"""
pass
class TestQuotation(IntegrationTestCase):
def test_quotation_qty(self):
qo = make_quotation(qty=0, do_not_save=True)