test: fix for Item Tax Template v12
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index 77f8a0c..ff87ba3 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -145,7 +145,7 @@
 	conditions = ["""(from_date is null or from_date <= '{0}')
 		and (to_date is null or to_date >= '{0}')""".format(posting_date)]
 
-	conditions.append("ifnull(tax_category, '') = '{0}'".format(frappe.db.escape(cstr(args.get("tax_category")))))
+	conditions.append("ifnull(tax_category, '') = {0}".format(frappe.db.escape(cstr(args.get("tax_category")))))
 	if 'tax_category' in args.keys():
 		del args['tax_category']
 
diff --git a/erpnext/controllers/tests/test_qty_based_taxes.py b/erpnext/controllers/tests/test_qty_based_taxes.py
index d6eb6fd..fd9936b 100644
--- a/erpnext/controllers/tests/test_qty_based_taxes.py
+++ b/erpnext/controllers/tests/test_qty_based_taxes.py
@@ -27,6 +27,16 @@
             'item_group_name': uuid4(),
             'parent_item_group': 'All Item Groups',
         }).insert()
+        self.item_tax_template = frappe.get_doc({
+            'doctype': 'Item Tax Template',
+            'title': uuid4(),
+            'taxes': [
+                {
+                    'tax_type': self.account.name,
+                    'tax_rate': 2,
+                }
+            ]
+        }).insert()
         self.item = frappe.get_doc({
             'doctype': 'Item',
             'item_code': uuid4(),
@@ -34,8 +44,8 @@
             'is_stock_item': 0,
             'taxes': [
                 {
-                    'tax_type': self.account.name,
-                    'tax_rate': 2,
+                    'item_tax_template': self.item_tax_template.name,
+                    'tax_category': '',
                 }
             ],
         }).insert()
@@ -58,6 +68,7 @@
                 'doctype': dt,
                 'company': self.company.name,
                 'supplier': self.supplier.name,
+                'currency': "USD",
                 'schedule_date': frappe.utils.nowdate(),
                 'delivery_date': frappe.utils.nowdate(),
                 'customer': self.customer.name,
@@ -90,5 +101,6 @@
             doc.delete()
         self.item.delete()
         self.item_group.delete()
+        self.item_tax_template.delete()
         self.account.delete()
         self.company.delete()