コード例 #1
0
def test_duplicated_categories(fx_stages, fx_feed):
    stage, _ = fx_stages
    feed = fx_feed
    cate = Category(term='cake')

    feed.categories.append(cate)

    with stage:
        stage.feeds['test'] = feed
        stage.feeds['test'] = feed
        merged_feed = stage.feeds['test']

    assert len(merged_feed.categories) == len(feed.categories)
コード例 #2
0
def test_category_str():
    assert text_type(Category(term='python')) == 'python'
    assert text_type(Category(term='python', label='Python')) == 'Python'