mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 03:29:16 +00:00
refactor(test): make customer deterministic
This commit is contained in:
@@ -89,14 +89,11 @@ class TestCustomer(ERPNextTestSuite):
|
|||||||
def test_party_details_tax_category(self):
|
def test_party_details_tax_category(self):
|
||||||
from erpnext.accounts.party import get_party_details
|
from erpnext.accounts.party import get_party_details
|
||||||
|
|
||||||
frappe.delete_doc_if_exists("Address", "_Test Address With Tax Category-Billing")
|
|
||||||
frappe.delete_doc_if_exists("Address", "_Test Address With Tax Category-Shipping")
|
|
||||||
|
|
||||||
# Tax Category without Address
|
# Tax Category without Address
|
||||||
details = get_party_details("_Test Customer With Tax Category")
|
details = get_party_details("_Test Customer With Tax Category")
|
||||||
self.assertEqual(details.tax_category, "_Test Tax Category 1")
|
self.assertEqual(details.tax_category, "_Test Tax Category 1")
|
||||||
|
|
||||||
billing_address = frappe.get_doc(
|
frappe.get_doc(
|
||||||
doctype="Address",
|
doctype="Address",
|
||||||
address_title="_Test Address With Tax Category",
|
address_title="_Test Address With Tax Category",
|
||||||
tax_category="_Test Tax Category 2",
|
tax_category="_Test Tax Category 2",
|
||||||
@@ -104,9 +101,10 @@ class TestCustomer(ERPNextTestSuite):
|
|||||||
address_line1="Station Road",
|
address_line1="Station Road",
|
||||||
city="_Test City",
|
city="_Test City",
|
||||||
country="India",
|
country="India",
|
||||||
|
is_primary_address=True,
|
||||||
links=[dict(link_doctype="Customer", link_name="_Test Customer With Tax Category")],
|
links=[dict(link_doctype="Customer", link_name="_Test Customer With Tax Category")],
|
||||||
).insert()
|
).insert()
|
||||||
shipping_address = frappe.get_doc(
|
frappe.get_doc(
|
||||||
doctype="Address",
|
doctype="Address",
|
||||||
address_title="_Test Address With Tax Category",
|
address_title="_Test Address With Tax Category",
|
||||||
tax_category="_Test Tax Category 3",
|
tax_category="_Test Tax Category 3",
|
||||||
@@ -114,6 +112,7 @@ class TestCustomer(ERPNextTestSuite):
|
|||||||
address_line1="Station Road",
|
address_line1="Station Road",
|
||||||
city="_Test City",
|
city="_Test City",
|
||||||
country="India",
|
country="India",
|
||||||
|
is_shipping_address=True,
|
||||||
links=[dict(link_doctype="Customer", link_name="_Test Customer With Tax Category")],
|
links=[dict(link_doctype="Customer", link_name="_Test Customer With Tax Category")],
|
||||||
).insert()
|
).insert()
|
||||||
|
|
||||||
@@ -135,8 +134,6 @@ class TestCustomer(ERPNextTestSuite):
|
|||||||
# Rollback
|
# Rollback
|
||||||
settings.determine_address_tax_category_from = rollback_setting
|
settings.determine_address_tax_category_from = rollback_setting
|
||||||
settings.save()
|
settings.save()
|
||||||
billing_address.delete()
|
|
||||||
shipping_address.delete()
|
|
||||||
|
|
||||||
def test_rename(self):
|
def test_rename(self):
|
||||||
# delete communication linked to these 2 customers
|
# delete communication linked to these 2 customers
|
||||||
|
|||||||
Reference in New Issue
Block a user