[fix] applicable territory patch and tax rule tests

This commit is contained in:
Anand Doshi 2015-09-24 15:42:21 +05:30
parent 0ea68b33ed
commit d37d4dfdec
2 changed files with 32 additions and 42 deletions

View File

@ -13,16 +13,6 @@ class TestTaxRule(unittest.TestCase):
def setUp(self): def setUp(self):
frappe.db.sql("delete from `tabTax Rule` where use_for_shopping_cart <> 1") frappe.db.sql("delete from `tabTax Rule` where use_for_shopping_cart <> 1")
def test_customer_group(self):
tax_rule = make_tax_rule(customer= "_Test Customer", customer_group= "_Test Customer Group 1",
sales_tax_template = "_Test Sales Taxes and Charges Template")
self.assertRaises(IncorrectCustomerGroup, tax_rule.save)
def test_supplier_type(self):
tax_rule = make_tax_rule(tax_type= "Purchase", supplier= "_Test Supplier", supplier_type= "_Test Supplier Type 1",
purchase_tax_template = "_Test Purchase Taxes and Charges Template")
self.assertRaises(IncorrectSupplierType, tax_rule.save)
def test_conflict(self): def test_conflict(self):
tax_rule1 = make_tax_rule(customer= "_Test Customer", tax_rule1 = make_tax_rule(customer= "_Test Customer",
sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1) sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1)
@ -138,4 +128,3 @@ def make_tax_rule(**args):
tax_rule.insert() tax_rule.insert()
return tax_rule return tax_rule

View File

@ -5,6 +5,7 @@ def execute():
frappe.reload_doc("accounts", "doctype", "shipping_rule_country") frappe.reload_doc("accounts", "doctype", "shipping_rule_country")
frappe.reload_doctype("Price List") frappe.reload_doctype("Price List")
frappe.reload_doctype("Shipping Rule") frappe.reload_doctype("Shipping Rule")
frappe.reload_doctype("Shopping Cart Settings")
# for price list # for price list
countries = frappe.db.sql_list("select name from tabCountry") countries = frappe.db.sql_list("select name from tabCountry")