示例#1
0
def test_delete_success():
    portfolio = PortfolioFactory.create()

    assert not portfolio.deleted

    Portfolios.delete(portfolio=portfolio)

    assert portfolio.deleted
示例#2
0
def test_delete_failure_with_applications():
    portfolio = PortfolioFactory.create()
    application = ApplicationFactory.create(portfolio=portfolio)

    assert not portfolio.deleted

    with pytest.raises(PortfolioDeletionApplicationsExistError):
        Portfolios.delete(portfolio=portfolio)

    assert not portfolio.deleted
示例#3
0
文件: index.py 项目: v1psta/atst
def delete_portfolio(portfolio_id):
    Portfolios.delete(portfolio=g.portfolio)

    flash("portfolio_deleted", portfolio_name=g.portfolio.name)

    return redirect(url_for("atst.home"))