def setup_class(self): if not is_search_supported(): raise SkipTest("Search not supported") indexer = TestSearchIndexer() model.Session.remove() CreateTestData.create_search_test_data() # now remove a tag so we can test search with deleted tags model.repo.new_revision() gils = model.Package.by_name(u'gils') # an existing tag used only by gils self.tagname = u'registry' # we aren't guaranteed it is last ... idx = [t.name for t in gils.tags].index(self.tagname) del gils.tags[idx] model.repo.commit_and_remove() indexer.index() self.gils = model.Package.by_name(u'gils') self.war = model.Package.by_name(u'warandpeace') self.russian = model.Tag.by_name(u'russian') self.tolstoy = model.Tag.by_name(u'tolstoy') self.backend = get_backend(backend='sql')
def setup_class(self): if not is_search_supported(): raise SkipTest("Search not supported") indexer = TestSearchIndexer() model.Session.remove() CreateTestData.create_search_test_data() # now remove a tag so we can test search with deleted tags model.repo.new_revision() gils = model.Package.by_name(u'gils') # an existing tag used only by gils self.tagname = u'registry' # we aren't guaranteed it is last ... idx = [ t.name for t in gils.tags].index(self.tagname) del gils.tags[idx] model.repo.commit_and_remove() indexer.index() self.gils = model.Package.by_name(u'gils') self.war = model.Package.by_name(u'warandpeace') self.russian = model.Tag.by_name(u'russian') self.tolstoy = model.Tag.by_name(u'tolstoy') self.backend = get_backend(backend='sql')
def search(ctx): flask_app = ctx.meta['flask_app'] with flask_app.test_request_context(): CreateTestData.create_search_test_data()
def search(ctx): flask_app = ctx.obj.app.apps[u'flask_app']._wsgi_app with flask_app.test_request_context(): CreateTestData.create_search_test_data()