mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
refactor(test): deterministic test suite for sales invoice
This commit is contained in:
@@ -121,7 +121,6 @@ def create_dimension():
|
|||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"reference_document": "Location",
|
"reference_document": "Location",
|
||||||
"default_dimension": "Block 1",
|
"default_dimension": "Block 1",
|
||||||
"mandatory_for_bs": 1,
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2230,13 +2230,13 @@ class TestSalesInvoice(ERPNextTestSuite):
|
|||||||
self.assertEqual(expected_account_values[1], gle.credit)
|
self.assertEqual(expected_account_values[1], gle.credit)
|
||||||
|
|
||||||
def test_rounding_adjustment_3(self):
|
def test_rounding_adjustment_3(self):
|
||||||
from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import (
|
from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import create_dimension
|
||||||
create_dimension,
|
|
||||||
disable_dimension,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
# Dimension creates custom field, which does an implicit DB commit as it is a DDL command
|
||||||
|
# Ensure dimension don't have any mandatory fields
|
||||||
create_dimension()
|
create_dimension()
|
||||||
|
|
||||||
|
# rollback from tearDown() happens till here
|
||||||
si = create_sales_invoice(do_not_save=True)
|
si = create_sales_invoice(do_not_save=True)
|
||||||
si.items = []
|
si.items = []
|
||||||
for d in [(1122, 2), (1122.01, 1), (1122.01, 1)]:
|
for d in [(1122, 2), (1122.01, 1), (1122.01, 1)]:
|
||||||
@@ -2317,8 +2317,6 @@ class TestSalesInvoice(ERPNextTestSuite):
|
|||||||
self.assertEqual(round_off_gle.cost_center, "_Test Cost Center 2 - _TC")
|
self.assertEqual(round_off_gle.cost_center, "_Test Cost Center 2 - _TC")
|
||||||
self.assertEqual(round_off_gle.location, "Block 1")
|
self.assertEqual(round_off_gle.location, "Block 1")
|
||||||
|
|
||||||
disable_dimension()
|
|
||||||
|
|
||||||
def test_sales_invoice_with_shipping_rule(self):
|
def test_sales_invoice_with_shipping_rule(self):
|
||||||
from erpnext.accounts.doctype.shipping_rule.test_shipping_rule import create_shipping_rule
|
from erpnext.accounts.doctype.shipping_rule.test_shipping_rule import create_shipping_rule
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user