feat: do not update search index in tests

This commit is contained in:
Shivam Mishra 2020-08-10 12:50:49 +05:30
parent b76a01f28d
commit e1d9909b78

View file

@ -148,7 +148,7 @@ class WebsiteGenerator(Document):
def remove_old_route_from_index(self):
"""Remove page from the website index if the route has changed."""
if self.allow_website_search_indexing():
if self.allow_website_search_indexing() or frappe.flags.in_test:
return
old_doc = self.get_doc_before_save()
# Check if the route is changed
@ -162,7 +162,7 @@ class WebsiteGenerator(Document):
- remove document from index if document is unpublished
- update index otherwise
"""
if not self.allow_website_search_indexing():
if not self.allow_website_search_indexing() or frappe.flags.in_test:
return
if self.is_website_published():