Fix tests when sphinx search engine is not enabled