Beispiel #1
0
def _(browser=browser):
    user = UserFactory.create(password="******", role=ERole.ADMIN)

    browser.visit(url_for("auth.login"))
    browser.fill("email", user.email)
    browser.fill("password", "admin1254")
    browser.find_by_value("Entrar").click()

    assert browser.is_text_present(user.email)
    assert browser.is_text_present("sair")
Beispiel #2
0
def _(browser=browser):
    user = UserFactory.create(password="******", role=ERole.ADMIN)

    browser.visit(url_for("auth.login"))
    browser.fill("email", user.email)
    browser.fill("password", "admin1254")
    browser.find_by_value("Entrar").click()

    browser.visit(url_for("auth.login"))

    assert browser.url == "http://localhost/"
Beispiel #3
0
def _(browser=browser):
    user = UserFactory.create(password="******", role=ERole.STAFF)

    browser.visit(url_for("auth.login"))
    browser.fill("email", user.email)
    browser.fill("password", "admin1254")
    browser.find_by_value("Entrar").click()
    browser.visit(url_for("admin.index"))

    assert browser.status_code.code == 403
    assert browser.is_text_present(
        "você não possui acesso suficiente para acessar está página."
    )