Beispiel #1
0
def keywords_categorizer():
    keywords_tree = Keyword.get_all_hierarchically()
    return render_template('keywords_categorizer.html',
                           title="Keywords Categorizer",
                           keywords_tree=keywords_tree,
                           unassociated_keywords=Keyword.get_all(
                               and_(~Keyword.categories.any(),
                                    Keyword.value != None)))
Beispiel #2
0
def test_get_all_keywords_hierarchically(client):
    def assertion(keywords):
        assert len(keywords) == 3
        assert len(keywords[1]['children']) > 0
        assert keywords[2]['count'] > 0
        assert type(keywords[3]['keywords']) is list

    t = TimeCalculator('keywords_hierarchically')
    assertion(Keyword.get_all_hierarchically())
    t.get_running_time()