diff --git a/erpnext/stock/doctype/bin/test_bin.py b/erpnext/stock/doctype/bin/test_bin.py index ef21bcf7833..e66e453aca1 100644 --- a/erpnext/stock/doctype/bin/test_bin.py +++ b/erpnext/stock/doctype/bin/test_bin.py @@ -27,6 +27,6 @@ class TestBin(ERPNextTestSuite): self.assertEqual(bin.item_code, item_code) def test_index_exists(self): - indexes = frappe.db.sql("show index from tabBin where Non_unique = 0", as_dict=1) - if not any(index.get("Key_name") == "unique_item_warehouse" for index in indexes): + # has_index is db-agnostic; raw "SHOW INDEX" is MySQL-only and errors on Postgres + if not frappe.db.has_index("tabBin", "unique_item_warehouse"): self.fail("Expected unique index on item-warehouse")