Fixed test cases tax rule

This commit is contained in:
Rohit Waghchaure 2017-09-15 23:10:27 +05:30
parent f8f29677fd
commit 2cb2064c6f
2 changed files with 3 additions and 2 deletions

View File

@ -135,7 +135,8 @@ def get_tax_template(posting_date, args):
for key, value in args.iteritems(): for key, value in args.iteritems():
if key=="use_for_shopping_cart": if key=="use_for_shopping_cart":
conditions.append("use_for_shopping_cart = {0}".format(1 if value else 0)) conditions.append("use_for_shopping_cart = {0}".format(1 if value else 0))
if key == 'customer_group' and value: if key == 'customer_group':
if not value: value = "All Customer Groups"
customer_group_condition = get_customer_group_condition(value) customer_group_condition = get_customer_group_condition(value)
conditions.append("ifnull({0}, '') in ('', {1})".format(key, customer_group_condition)) conditions.append("ifnull({0}, '') in ('', {1})".format(key, customer_group_condition))
else: else:

View File

@ -39,7 +39,7 @@ class TestTaxRule(unittest.TestCase):
sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, from_date = "2015-01-01") sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, from_date = "2015-01-01")
tax_rule1.save() tax_rule1.save()
self.assertEquals(get_tax_template("2015-01-01", {"customer_group" : "Commercial"}), self.assertEquals(get_tax_template("2015-01-01", {"customer_group" : "Commercial", "use_for_shopping_cart":0}),
"_Test Sales Taxes and Charges Template") "_Test Sales Taxes and Charges Template")
def test_conflict_with_overlapping_dates(self): def test_conflict_with_overlapping_dates(self):