chore: update sql function usage

This commit is contained in:
Faris Ansari 2025-05-26 11:57:49 +05:30
parent b2e081d076
commit ae3f216255

View file

@ -75,7 +75,7 @@ class TestDB(IntegrationTestCase):
frappe.db.sql("SELECT Max(name) FROM tabUser")[0][0],
)
self.assertEqual(
frappe.db.get_value("User", {}, {"MIN": "name"}, order_by=None),
frappe.db.get_value("User", {}, [{"MIN": "name"}], order_by=None),
frappe.db.sql("SELECT Min(name) FROM tabUser")[0][0],
)
self.assertIn(
@ -374,7 +374,7 @@ class TestDB(IntegrationTestCase):
random_field,
)
self.assertEqual(
next(iter(frappe.get_all("ToDo", fields=[{"count": random_field}], limit=1)[0])),
next(iter(frappe.get_all("ToDo", fields=[{"COUNT": random_field}], limit=1)[0])),
"count" if frappe.conf.db_type == "postgres" else f"count(`{random_field}`)",
)