From a87899c2155a0c2576d551a31aa5f6535be6930b Mon Sep 17 00:00:00 2001 From: Pruthvi Patel Date: Tue, 11 Jan 2022 11:12:53 +0530 Subject: [PATCH] test: add test for limit --- frappe/tests/test_document.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frappe/tests/test_document.py b/frappe/tests/test_document.py index 29cec8b230..34a1dd070c 100644 --- a/frappe/tests/test_document.py +++ b/frappe/tests/test_document.py @@ -252,3 +252,8 @@ class TestDocument(unittest.TestCase): 'currency': 100000 }) self.assertEquals(d.get_formatted('currency', currency='INR', format="#,###.##"), '₹ 100,000.00') + + def test_limit_for_get(self): + doc = frappe.get_doc("DocType", "DocType") + # assuming DocType has more that 3 Data fields + self.assertEquals(len(doc.get("fields", filters={"fieldtype": "Data"}, limit=3)), 3) \ No newline at end of file