예제 #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))