summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-api/opendc/api/v2/portfolios
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-api/opendc/api/v2/portfolios')
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/scenarios/test_endpoint.py4
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/test_endpoint.py15
2 files changed, 8 insertions, 11 deletions
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/scenarios/test_endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/scenarios/test_endpoint.py
index e5982b7f..ff1666c0 100644
--- a/opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/scenarios/test_endpoint.py
+++ b/opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/scenarios/test_endpoint.py
@@ -37,7 +37,7 @@ def test_add_scenario_not_authorized(client, mocker):
'projectId': test_id,
'portfolioId': test_id,
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'VIEW'
}]
})
@@ -71,7 +71,7 @@ def test_add_scenario(client, mocker):
'portfolioIds': [test_id],
'scenarioIds': [test_id],
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'EDIT'
}],
'simulation': {
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/test_endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/test_endpoint.py
index 52f71aa4..1a44c63d 100644
--- a/opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/test_endpoint.py
+++ b/opendc-web/opendc-web-api/opendc/api/v2/portfolios/portfolioId/test_endpoint.py
@@ -21,10 +21,7 @@ def test_get_portfolio_not_authorized(client, mocker):
return_value={
'projectId': test_id,
'_id': test_id,
- 'authorizations': [{
- 'projectId': test_id_2,
- 'authorizationLevel': 'OWN'
- }]
+ 'authorizations': []
})
res = client.get(f'/v2/portfolios/{test_id}')
assert '403' in res.status
@@ -37,7 +34,7 @@ def test_get_portfolio(client, mocker):
'projectId': test_id,
'_id': test_id,
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'EDIT'
}]
})
@@ -69,7 +66,7 @@ def test_update_portfolio_not_authorized(client, mocker):
'_id': test_id,
'projectId': test_id,
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'VIEW'
}]
})
@@ -92,7 +89,7 @@ def test_update_portfolio(client, mocker):
'_id': test_id,
'projectId': test_id,
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'OWN'
}],
'targets': {
@@ -125,7 +122,7 @@ def test_delete_project_different_user(client, mocker):
'projectId': test_id,
'googleId': 'other_test',
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'VIEW'
}]
})
@@ -142,7 +139,7 @@ def test_delete_project(client, mocker):
'googleId': 'test',
'portfolioIds': [test_id],
'authorizations': [{
- 'projectId': test_id,
+ 'userId': 'test',
'authorizationLevel': 'OWN'
}]
})