From 0bd145a6086638ff753e9a552cf51e52c60dc9e7 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 15 Sep 2015 17:06:52 +0530 Subject: [PATCH] [fixes] test cases and tax rule validation --- erpnext/accounts/doctype/tax_rule/tax_rule.py | 2 ++ erpnext/accounts/doctype/tax_rule/test_records.json | 2 ++ erpnext/accounts/doctype/tax_rule/test_tax_rule.py | 4 ++-- erpnext/utilities/doctype/address/test_records.json | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py index 93bbf459c3..0a9bb1114b 100644 --- a/erpnext/accounts/doctype/tax_rule/tax_rule.py +++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py @@ -53,8 +53,10 @@ class TaxRule(Document): "supplier": self.supplier, "supplier_type": self.supplier_type, "billing_city": self.billing_city, + "billing_state": self.billing_state, "billing_country": self.billing_country, "shipping_city": self.shipping_city, + "shipping_state": self.shipping_state, "shipping_country": self.shipping_country, "company": self.company } diff --git a/erpnext/accounts/doctype/tax_rule/test_records.json b/erpnext/accounts/doctype/tax_rule/test_records.json index ebfb0c5b1b..0913fba4fb 100644 --- a/erpnext/accounts/doctype/tax_rule/test_records.json +++ b/erpnext/accounts/doctype/tax_rule/test_records.json @@ -5,6 +5,7 @@ "sales_tax_template": "_Test Tax 1", "use_for_shopping_cart": 1, "billing_city": "_Test City", + "billing_state": "Test State", "billing_country": "India", "shipping_city": "_Test City", "shipping_country": "India", @@ -19,6 +20,7 @@ "billing_city": "_Test City", "billing_country": "India", "shipping_city": "_Test City", + "shipping_state": "Test State", "shipping_country": "India", "priority": 2, "company": "_Test Company" diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py index 85fbe52220..3e175fabf7 100644 --- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py +++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py @@ -7,11 +7,11 @@ import frappe import unittest from erpnext.accounts.doctype.tax_rule.tax_rule import IncorrectCustomerGroup, IncorrectSupplierType, ConflictingTaxRule, get_tax_template -# test_records = frappe.get_test_records('Tax Rule') +test_records = frappe.get_test_records('Tax Rule') class TestTaxRule(unittest.TestCase): def setUp(self): - frappe.db.sql("delete from `tabTax Rule`") + 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", diff --git a/erpnext/utilities/doctype/address/test_records.json b/erpnext/utilities/doctype/address/test_records.json index 41a6abcd09..a7bde9a814 100644 --- a/erpnext/utilities/doctype/address/test_records.json +++ b/erpnext/utilities/doctype/address/test_records.json @@ -3,7 +3,8 @@ "address_line1": "_Test Address Line 1", "address_title": "_Test Address", "address_type": "Office", - "city": "_Test City", + "city": "_Test City", + "state": "Test State", "country": "India", "customer": "_Test Customer", "customer_name": "_Test Customer",