Update tests - remove references to Workspace, use url_for, and check to make sure time_updated does not change on the application
This commit is contained in:
parent
5d2b8556ed
commit
b5571000fe
@ -173,11 +173,16 @@ def test_user_can_only_access_apps_in_their_portfolio(client, user_session):
|
|||||||
|
|
||||||
# user can't view application edit form
|
# user can't view application edit form
|
||||||
response = client.get(
|
response = client.get(
|
||||||
"/portfolios/{}/applications/{}/edit".format(portfolio.id, other_application.id)
|
url_for(
|
||||||
|
"portfolios.edit_application",
|
||||||
|
portfolio_id=portfolio.id,
|
||||||
|
application_id=other_application.id,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
assert response.status_code == 404
|
assert response.status_code == 404
|
||||||
|
|
||||||
# user can't post update application form
|
# user can't post update application form
|
||||||
|
time_updated = other_application.time_updated
|
||||||
response = client.post(
|
response = client.post(
|
||||||
url_for(
|
url_for(
|
||||||
"portfolios.update_application",
|
"portfolios.update_application",
|
||||||
@ -185,9 +190,9 @@ def test_user_can_only_access_apps_in_their_portfolio(client, user_session):
|
|||||||
application_id=other_application.id,
|
application_id=other_application.id,
|
||||||
),
|
),
|
||||||
data={"name": "New Name", "description": "A new description."},
|
data={"name": "New Name", "description": "A new description."},
|
||||||
follow_redirects=True,
|
|
||||||
)
|
)
|
||||||
assert response.status_code == 404
|
assert response.status_code == 404
|
||||||
|
assert time_updated == other_application.time_updated
|
||||||
|
|
||||||
# user can't view application members
|
# user can't view application members
|
||||||
response = client.get(
|
response = client.get(
|
||||||
|
@ -173,12 +173,12 @@ def test_user_can_only_revoke_invites_in_their_portfolio(client, user_session):
|
|||||||
portfolio = PortfolioFactory.create()
|
portfolio = PortfolioFactory.create()
|
||||||
other_portfolio = PortfolioFactory.create()
|
other_portfolio = PortfolioFactory.create()
|
||||||
user = UserFactory.create()
|
user = UserFactory.create()
|
||||||
ws_role = PortfolioRoleFactory.create(
|
portfolio_role = PortfolioRoleFactory.create(
|
||||||
user=user, portfolio=other_portfolio, status=PortfolioRoleStatus.PENDING
|
user=user, portfolio=other_portfolio, status=PortfolioRoleStatus.PENDING
|
||||||
)
|
)
|
||||||
invite = InvitationFactory.create(
|
invite = InvitationFactory.create(
|
||||||
user_id=user.id,
|
user_id=user.id,
|
||||||
portfolio_role=ws_role,
|
portfolio_role=portfolio_role,
|
||||||
status=InvitationStatus.REJECTED_EXPIRED,
|
status=InvitationStatus.REJECTED_EXPIRED,
|
||||||
expiration_time=datetime.datetime.now() - datetime.timedelta(seconds=1),
|
expiration_time=datetime.datetime.now() - datetime.timedelta(seconds=1),
|
||||||
)
|
)
|
||||||
@ -199,12 +199,12 @@ def test_user_can_only_resend_invites_in_their_portfolio(client, user_session, q
|
|||||||
portfolio = PortfolioFactory.create()
|
portfolio = PortfolioFactory.create()
|
||||||
other_portfolio = PortfolioFactory.create()
|
other_portfolio = PortfolioFactory.create()
|
||||||
user = UserFactory.create()
|
user = UserFactory.create()
|
||||||
ws_role = PortfolioRoleFactory.create(
|
portfolio_role = PortfolioRoleFactory.create(
|
||||||
user=user, portfolio=other_portfolio, status=PortfolioRoleStatus.PENDING
|
user=user, portfolio=other_portfolio, status=PortfolioRoleStatus.PENDING
|
||||||
)
|
)
|
||||||
invite = InvitationFactory.create(
|
invite = InvitationFactory.create(
|
||||||
user_id=user.id,
|
user_id=user.id,
|
||||||
portfolio_role=ws_role,
|
portfolio_role=portfolio_role,
|
||||||
status=InvitationStatus.REJECTED_EXPIRED,
|
status=InvitationStatus.REJECTED_EXPIRED,
|
||||||
expiration_time=datetime.datetime.now() - datetime.timedelta(seconds=1),
|
expiration_time=datetime.datetime.now() - datetime.timedelta(seconds=1),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user