fix: test

This commit is contained in:
Saqib Ansari
2020-05-15 05:26:41 +05:30
parent 441bb760ee
commit 0af125f6fe
2 changed files with 4 additions and 3 deletions

View File

@@ -15,12 +15,12 @@ class TestPOSProfile(unittest.TestCase):
pos_profile = get_pos_profile("_Test Company") or {}
if pos_profile:
doc = frappe.get_doc("POS Profile", pos_profile.get("name"))
doc.append('item_groups', {'item_group': '_Test Item Group'})
doc.append('customer_groups', {'customer_group': '_Test Customer Group'})
doc.set('item_groups', [{'item_group': '_Test Item Group'}])
doc.set('customer_groups', [{'customer_group': '_Test Customer Group'}])
doc.save()
items = get_items_list(doc, doc.company)
customers = get_customers_list(doc)
products_count = frappe.db.sql(""" select count(name) from tabItem where item_group = '_Test Item Group'""", as_list=1)
customers_count = frappe.db.sql(""" select count(name) from tabCustomer where customer_group = '_Test Customer Group'""")

View File

@@ -189,6 +189,7 @@ def get_items_list(pos_profile, company):
where
i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1
{cond}
group by i.item_code
""".format(cond=cond), tuple([company] + args_list), as_dict=1)