ChillarAnand | 9ace7d6 | 2022-03-07 16:53:59 +0530 | [diff] [blame] | 1 | import frappe |
| 2 | from frappe.tests.utils import FrappeTestCase |
| 3 | |
| 4 | from erpnext.accounts.party import get_default_price_list |
| 5 | |
| 6 | |
| 7 | class PartyTestCase(FrappeTestCase): |
| 8 | def test_get_default_price_list_should_return_none_for_invalid_group(self): |
Ankush Menat | 494bd9e | 2022-03-28 18:52:46 +0530 | [diff] [blame] | 9 | customer = frappe.get_doc( |
| 10 | { |
| 11 | "doctype": "Customer", |
| 12 | "customer_name": "test customer", |
| 13 | } |
| 14 | ).insert(ignore_permissions=True, ignore_mandatory=True) |
ChillarAnand | 9ace7d6 | 2022-03-07 16:53:59 +0530 | [diff] [blame] | 15 | customer.customer_group = None |
| 16 | customer.save() |
| 17 | price_list = get_default_price_list(customer) |
| 18 | assert price_list is None |