Ejemplo n.º 1
0
def test_no_unpublished_posts_in_blog_roll(web_server: str, browser: DriverAPI,
                                           dbsession: Session, fakefactory):
    """Visitors sees no unpublished posts in blog-roll."""

    # creating a private post, it should not be listed in roll for a visitor
    with transaction.manager:
        fakefactory.PostFactory(private=True)

    # after navigating to blog-roll there are no posts displayed
    browser.visit(web_server + "/blog/")
    assert browser.is_element_visible_by_css("#blog-no-posts")
Ejemplo n.º 2
0
def test_visitor_sees_only_published_posts_in_tag_roll(web_server: str,
                                                       browser: DriverAPI,
                                                       dbsession: Session,
                                                       fakefactory):
    """Visitors should not see unpublished posts in blog roll."""

    with transaction.manager:
        tag = fakefactory.TagFactory()
        fakefactory.PostFactory(private=True, tags=[tag])
        dbsession.expunge_all()

    browser.visit(web_server + "/blog/tag/{}".format(tag.title))
    assert browser.is_element_visible_by_css("#blog-no-posts")
Ejemplo n.º 3
0
def test_empty_blog(web_server: str, dbsession: Session, browser: DriverAPI):
    """We can render empty blog."""

    browser.visit(web_server + "/blog/")
    # After login we see a profile link to our profile
    assert browser.is_element_visible_by_css("#blog-no-posts")