def search(path=None): query = request.args.get('query', '') filters = [item.split('=', 1) for item in path.split('/')] \ if path else [] ignores = [item[0] for item in filters] hits = Document.search(query, filters) facets = Document.facets(hits, ignores=ignores) return render_template('search.j2', query=query, path=path, hits=hits, facets=facets, total=Document.count())
def test_count(database): assert Document.count() == 3
def test_load_fixtures(): db.create_all() load_fixtures() assert Document.count() == 3