Files
schuetz3-erpnext/erpnext/tests/test_perf.py
Nabin Hait d392660d45 chore: release version 15.39.1 (#43800)
* fix: map doc from purchase order

(cherry picked from commit 60ceb91ace)

* test: auto create purchase receipt

(cherry picked from commit 59887bbc13)

* fix: better implementation, handle missing purchase order

(cherry picked from commit 66211dafd6)

* perf: performance optimizations for accounting reports by refactoring account closing balance and period closing voucher (#43798)

* fix: Gl Entry form cleanup

* fix: Added indexes in gl entry table

* perf: Refactored period closing voucher to handle large volume of gle

* fix: fixes as per new period start and end date fields in PCV

* perf: performance optimization for  accounting reports

* perf: performance optimizations for account closing balance patch

* fix: test cases

* fix: lenter issues - direct use of sql query

* fix: test cases

* fix: test cases

* fix: test cases

* fix: wrong fieldname

* fix: test cases

---------

Co-authored-by: Ninad1306 <ninad_1063@yahoo.com>
Co-authored-by: Smit Vora <smitvora203@gmail.com>
2024-10-23 14:27:10 +05:30

25 lines
713 B
Python

import frappe
from frappe.tests.utils import FrappeTestCase
INDEXED_FIELDS = {
"Bin": ["item_code"],
"GL Entry": ["voucher_no", "posting_date", "company", "party"],
"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
# updated accordingly.
for doctype, fields in INDEXED_FIELDS.items():
for field in fields:
self.assertTrue(
frappe.db.sql(
f"""SHOW INDEX FROM `tab{doctype}`
WHERE Column_name = "{field}" AND Seq_in_index = 1"""
)
)