示例#1
0
文件: test_all.py 项目: oz123/blogit
def test_render_index():
    le, all_entries = _get_last_entries(DB, 10)
    update_index(le)
    with open(os.path.join(CONFIG['output_to'], 'index.html')) as html_index:
        soup = BeautifulSoup(html_index.read(), 'html.parser')
        assert len(soup.find_all(class_='clearfix entry')) == 10
示例#2
0
文件: test_all.py 项目: oz123/blogit
def test_render_index():
    le, all_entries = _get_last_entries(DB, 10)
    update_index(le)
    with open(os.path.join(CONFIG['output_to'], 'index.html')) as html_index:
        soup = BeautifulSoup(html_index.read(), 'html.parser')
        assert len(soup.find_all(class_='clearfix entry')) == 10
示例#3
0
文件: test_all.py 项目: oz123/blogit
def test_get_last_entries():

    assert len(DB.posts.all()) == 22
    le, all = _get_last_entries(DB, 10)
    assert [e.id for e in le] == list(range(22, 12, -1))
示例#4
0
文件: test_all.py 项目: oz123/blogit
def test_get_last_entries():

    assert len(DB.posts.all()) == 22
    le, all = _get_last_entries(DB, 10)
    assert [e.id for e in le] == list(range(22, 12, -1))