mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-25 06:02:09 +01:00
refactor: load journal entry test records and make holiday list
This commit is contained in:
@@ -12,6 +12,9 @@ from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestJournalEntry(ERPNextTestSuite):
|
||||
def setUp(self):
|
||||
self.load_test_records("Journal Entry")
|
||||
|
||||
@ERPNextTestSuite.change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
|
||||
def test_journal_entry_with_against_jv(self):
|
||||
jv_invoice = frappe.copy_doc(self.globalTestRecords["Journal Entry"][2])
|
||||
|
||||
94
erpnext/accounts/doctype/journal_entry/test_records.json
Normal file
94
erpnext/accounts/doctype/journal_entry/test_records.json
Normal file
@@ -0,0 +1,94 @@
|
||||
[
|
||||
{
|
||||
"cheque_date": "2013-03-14",
|
||||
"cheque_no": "33",
|
||||
"company": "_Test Company",
|
||||
"doctype": "Journal Entry",
|
||||
"accounts": [
|
||||
{
|
||||
"account": "Debtors - _TC",
|
||||
"party_type": "Customer",
|
||||
"party": "_Test Customer",
|
||||
"credit_in_account_currency": 400.0,
|
||||
"debit_in_account_currency": 0.0,
|
||||
"doctype": "Journal Entry Account",
|
||||
"parentfield": "accounts",
|
||||
"cost_center": "_Test Cost Center - _TC"
|
||||
},
|
||||
{
|
||||
"account": "_Test Bank - _TC",
|
||||
"credit_in_account_currency": 0.0,
|
||||
"debit_in_account_currency": 400.0,
|
||||
"doctype": "Journal Entry Account",
|
||||
"parentfield": "accounts",
|
||||
"cost_center": "_Test Cost Center - _TC"
|
||||
}
|
||||
],
|
||||
"naming_series": "_T-Journal Entry-",
|
||||
"posting_date": "2013-02-14",
|
||||
"user_remark": "test",
|
||||
"voucher_type": "Bank Entry"
|
||||
},
|
||||
|
||||
{
|
||||
"cheque_date": "2013-02-14",
|
||||
"cheque_no": "33",
|
||||
"company": "_Test Company",
|
||||
"doctype": "Journal Entry",
|
||||
"accounts": [
|
||||
{
|
||||
"account": "_Test Payable - _TC",
|
||||
"party_type": "Supplier",
|
||||
"party": "_Test Supplier",
|
||||
"credit_in_account_currency": 0.0,
|
||||
"debit_in_account_currency": 400.0,
|
||||
"doctype": "Journal Entry Account",
|
||||
"parentfield": "accounts",
|
||||
"cost_center": "_Test Cost Center - _TC"
|
||||
},
|
||||
{
|
||||
"account": "_Test Bank - _TC",
|
||||
"credit_in_account_currency": 400.0,
|
||||
"debit_in_account_currency": 0.0,
|
||||
"doctype": "Journal Entry Account",
|
||||
"parentfield": "accounts",
|
||||
"cost_center": "_Test Cost Center - _TC"
|
||||
}
|
||||
],
|
||||
"naming_series": "_T-Journal Entry-",
|
||||
"posting_date": "2013-02-14",
|
||||
"user_remark": "test",
|
||||
"voucher_type": "Bank Entry"
|
||||
},
|
||||
|
||||
{
|
||||
"cheque_date": "2013-02-14",
|
||||
"cheque_no": "33",
|
||||
"company": "_Test Company",
|
||||
"doctype": "Journal Entry",
|
||||
"accounts": [
|
||||
{
|
||||
"account": "Debtors - _TC",
|
||||
"party_type": "Customer",
|
||||
"party": "_Test Customer",
|
||||
"credit_in_account_currency": 0.0,
|
||||
"debit_in_account_currency": 400.0,
|
||||
"doctype": "Journal Entry Account",
|
||||
"parentfield": "accounts",
|
||||
"cost_center": "_Test Cost Center - _TC"
|
||||
},
|
||||
{
|
||||
"account": "Sales - _TC",
|
||||
"credit_in_account_currency": 400.0,
|
||||
"debit_in_account_currency": 0.0,
|
||||
"doctype": "Journal Entry Account",
|
||||
"parentfield": "accounts",
|
||||
"cost_center": "_Test Cost Center - _TC"
|
||||
}
|
||||
],
|
||||
"naming_series": "_T-Journal Entry-",
|
||||
"posting_date": "2013-02-14",
|
||||
"user_remark": "test",
|
||||
"voucher_type": "Bank Entry"
|
||||
}
|
||||
]
|
||||
@@ -186,6 +186,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
@classmethod
|
||||
def make_persistent_master_data(cls):
|
||||
cls.make_fiscal_year()
|
||||
cls.make_holiday_list()
|
||||
cls.make_company()
|
||||
cls.make_test_account()
|
||||
cls.make_supplier_group()
|
||||
@@ -744,7 +745,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"doctype": "Company",
|
||||
"domain": "Manufacturing",
|
||||
"chart_of_accounts": "Standard",
|
||||
# "default_holiday_list": cls.holiday_list[0].name,
|
||||
"default_holiday_list": cls.holiday_list[0].name,
|
||||
"enable_perpetual_inventory": 0,
|
||||
"allow_account_creation_against_child_company": 1,
|
||||
},
|
||||
@@ -756,7 +757,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"doctype": "Company",
|
||||
"domain": "Retail",
|
||||
"chart_of_accounts": "Standard",
|
||||
# "default_holiday_list": cls.holiday_list[0].name,
|
||||
"default_holiday_list": cls.holiday_list[0].name,
|
||||
"enable_perpetual_inventory": 0,
|
||||
},
|
||||
{
|
||||
@@ -767,7 +768,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"doctype": "Company",
|
||||
"domain": "Retail",
|
||||
"chart_of_accounts": "Standard",
|
||||
# "default_holiday_list": cls.holiday_list[0].name,
|
||||
"default_holiday_list": cls.holiday_list[0].name,
|
||||
"enable_perpetual_inventory": 0,
|
||||
},
|
||||
{
|
||||
@@ -779,7 +780,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"doctype": "Company",
|
||||
"domain": "Manufacturing",
|
||||
"chart_of_accounts": "Standard",
|
||||
# "default_holiday_list": cls.holiday_list[0].name,
|
||||
"default_holiday_list": cls.holiday_list[0].name,
|
||||
"enable_perpetual_inventory": 0,
|
||||
},
|
||||
{
|
||||
@@ -792,7 +793,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"doctype": "Company",
|
||||
"domain": "Manufacturing",
|
||||
"chart_of_accounts": "Standard",
|
||||
# "default_holiday_list": cls.holiday_list[0].name,
|
||||
"default_holiday_list": cls.holiday_list[0].name,
|
||||
"enable_perpetual_inventory": 0,
|
||||
},
|
||||
{
|
||||
@@ -804,7 +805,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"doctype": "Company",
|
||||
"domain": "Manufacturing",
|
||||
"chart_of_accounts": "Standard",
|
||||
# "default_holiday_list": cls.holiday_list[0].name,
|
||||
"default_holiday_list": cls.holiday_list[0].name,
|
||||
"enable_perpetual_inventory": 0,
|
||||
},
|
||||
{
|
||||
@@ -816,7 +817,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"domain": "Manufacturing",
|
||||
"chart_of_accounts": "Standard",
|
||||
"enable_perpetual_inventory": 1,
|
||||
# "default_holiday_list": cls.holiday_list[0].name,
|
||||
"default_holiday_list": cls.holiday_list[0].name,
|
||||
},
|
||||
{
|
||||
"abbr": "_TC6",
|
||||
@@ -827,7 +828,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"doctype": "Company",
|
||||
"domain": "Manufacturing",
|
||||
"chart_of_accounts": "Standard",
|
||||
# "default_holiday_list": cls.holiday_list[0].name,
|
||||
"default_holiday_list": cls.holiday_list[0].name,
|
||||
"enable_perpetual_inventory": 0,
|
||||
},
|
||||
{
|
||||
@@ -840,7 +841,7 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"doctype": "Company",
|
||||
"domain": "Manufacturing",
|
||||
"chart_of_accounts": "Standard",
|
||||
# "default_holiday_list": cls.holiday_list[0].name,
|
||||
"default_holiday_list": cls.holiday_list[0].name,
|
||||
"enable_perpetual_inventory": 0,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user