test: make global search tests less flaky
This commit is contained in:
parent
cbe673255b
commit
56f5b3d1f3
2 changed files with 3 additions and 3 deletions
|
|
@ -125,4 +125,4 @@ def get_documents():
|
|||
deploy business applications with Rich Admin Interface. CommonSearchTerm"""
|
||||
})
|
||||
|
||||
return docs
|
||||
return docs
|
||||
|
|
|
|||
|
|
@ -88,13 +88,13 @@ class TestGlobalSearch(unittest.TestCase):
|
|||
event = frappe.get_doc('Event', event_name)
|
||||
test_subject = event.subject
|
||||
results = global_search.search(test_subject)
|
||||
self.assertEqual(len(results), 1)
|
||||
self.assertTrue(any(r["name"] == event_name for r in results), msg="Failed to search document by exact name")
|
||||
|
||||
frappe.delete_doc('Event', event_name)
|
||||
global_search.sync_global_search()
|
||||
|
||||
results = global_search.search(test_subject)
|
||||
self.assertEqual(len(results), 0)
|
||||
self.assertTrue(all(r["name"] != event_name for r in results), msg="Deleted documents appearing in global search.")
|
||||
|
||||
def test_insert_child_table(self):
|
||||
frappe.db.delete("Event")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue