[fixes] test cases and tax rule validation

This commit is contained in:
Saurabh 2015-09-15 17:06:52 +05:30
parent c663f5c2bd
commit 0bd145a608
4 changed files with 8 additions and 3 deletions

View File

@ -53,8 +53,10 @@ class TaxRule(Document):
"supplier": self.supplier, "supplier": self.supplier,
"supplier_type": self.supplier_type, "supplier_type": self.supplier_type,
"billing_city": self.billing_city, "billing_city": self.billing_city,
"billing_state": self.billing_state,
"billing_country": self.billing_country, "billing_country": self.billing_country,
"shipping_city": self.shipping_city, "shipping_city": self.shipping_city,
"shipping_state": self.shipping_state,
"shipping_country": self.shipping_country, "shipping_country": self.shipping_country,
"company": self.company "company": self.company
} }

View File

@ -5,6 +5,7 @@
"sales_tax_template": "_Test Tax 1", "sales_tax_template": "_Test Tax 1",
"use_for_shopping_cart": 1, "use_for_shopping_cart": 1,
"billing_city": "_Test City", "billing_city": "_Test City",
"billing_state": "Test State",
"billing_country": "India", "billing_country": "India",
"shipping_city": "_Test City", "shipping_city": "_Test City",
"shipping_country": "India", "shipping_country": "India",
@ -19,6 +20,7 @@
"billing_city": "_Test City", "billing_city": "_Test City",
"billing_country": "India", "billing_country": "India",
"shipping_city": "_Test City", "shipping_city": "_Test City",
"shipping_state": "Test State",
"shipping_country": "India", "shipping_country": "India",
"priority": 2, "priority": 2,
"company": "_Test Company" "company": "_Test Company"

View File

@ -7,11 +7,11 @@ import frappe
import unittest import unittest
from erpnext.accounts.doctype.tax_rule.tax_rule import IncorrectCustomerGroup, IncorrectSupplierType, ConflictingTaxRule, get_tax_template 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): class TestTaxRule(unittest.TestCase):
def setUp(self): 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): def test_customer_group(self):
tax_rule = make_tax_rule(customer= "_Test Customer", customer_group= "_Test Customer Group 1", tax_rule = make_tax_rule(customer= "_Test Customer", customer_group= "_Test Customer Group 1",

View File

@ -3,7 +3,8 @@
"address_line1": "_Test Address Line 1", "address_line1": "_Test Address Line 1",
"address_title": "_Test Address", "address_title": "_Test Address",
"address_type": "Office", "address_type": "Office",
"city": "_Test City", "city": "_Test City",
"state": "Test State",
"country": "India", "country": "India",
"customer": "_Test Customer", "customer": "_Test Customer",
"customer_name": "_Test Customer", "customer_name": "_Test Customer",