| from frappe.tests.utils import FrappeTestCase |
| "GL Entry": ["voucher_type", "against_voucher_type"], |
| "Purchase Order Item": ["item_code"], |
| "Stock Ledger Entry": ["warehouse"], |
| class TestPerformance(FrappeTestCase): |
| def test_ensure_indexes(self): |
| # These fields are not explicitly indexed BUT they are prefix in some |
| # other composite index. If those are removed this test should be |
| for doctype, fields in INDEXED_FIELDS.items(): |
| f"""SHOW INDEX FROM `tab{doctype}` |
| WHERE Column_name = "{field}" AND Seq_in_index = 1""" |