test: add custom TestCase class and use in stock
(cherry picked from commit 06fa35a9c1)
This commit is contained in:
committed by
Ankush Menat
parent
816236b587
commit
89828defc5
@@ -2,6 +2,7 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
import copy
|
||||
import unittest
|
||||
from contextlib import contextmanager
|
||||
from typing import Any, Dict, NewType, Optional
|
||||
|
||||
@@ -12,6 +13,20 @@ ReportFilters = Dict[str, Any]
|
||||
ReportName = NewType("ReportName", str)
|
||||
|
||||
|
||||
class ERPNextTestCase(unittest.TestCase):
|
||||
"""A sane default test class for ERPNext tests."""
|
||||
|
||||
def setUp(self) -> None:
|
||||
frappe.db.commit()
|
||||
return super().setUp()
|
||||
|
||||
|
||||
def tearDown(self) -> None:
|
||||
frappe.db.rollback()
|
||||
return super().tearDown()
|
||||
|
||||
|
||||
|
||||
def create_test_contact_and_address():
|
||||
frappe.db.sql('delete from tabContact')
|
||||
frappe.db.sql('delete from `tabContact Email`')
|
||||
|
||||
Reference in New Issue
Block a user