Rearrange and rename application routes.

- move application routes to their own Flask blueprint
- squash application routes to be resource-specific
- reorganize application routes
This commit is contained in:
dandds
2019-04-18 14:54:45 -04:00
parent ed25078c39
commit 849c5d4b58
24 changed files with 583 additions and 646 deletions

View File

@@ -0,0 +1,21 @@
from flask import url_for
from tests.factories import PortfolioFactory
def test_creating_application(client, user_session):
portfolio = PortfolioFactory.create()
user_session(portfolio.owner)
response = client.post(
url_for("applications.create", portfolio_id=portfolio.id),
data={
"name": "Test Application",
"description": "This is only a test",
"environment_names-0": "dev",
"environment_names-1": "staging",
"environment_names-2": "prod",
},
)
assert response.status_code == 302
assert len(portfolio.applications) == 1
assert len(portfolio.applications[0].environments) == 3