Use application_role_id on environment_roles.
In the future, an `application_invitation1 will not refer to a `user` until someone accepts the invitation; they'll only reference an `application_role`. When a user is invited to an application, the inviter can specify the environments the invitee should have access to. For this to be possible, an `environment_role` should reference an `application_role`, because no `user` entity will be known at that time. In addition to updating all the models and domain methods necessary for this change, this commit deletes unused code and tests that were dependent on `environment_roles` having a `user_id` foreign key.
This commit is contained in:
@@ -84,7 +84,7 @@ def test_get_portfolio_events_includes_app_and_env_events():
|
||||
|
||||
# add environment level events
|
||||
env = EnvironmentFactory.create(application=application)
|
||||
env_role = EnvironmentRoleFactory.create(environment=env, user=app_role.user)
|
||||
env_role = EnvironmentRoleFactory.create(environment=env, application_role=app_role)
|
||||
portfolio_app_and_env_events = AuditLog.get_portfolio_events(portfolio)
|
||||
assert len(portfolio_and_app_events) < len(portfolio_app_and_env_events)
|
||||
|
||||
@@ -106,7 +106,7 @@ def test_get_application_events():
|
||||
app_role = ApplicationRoleFactory.create(application=application)
|
||||
app_invite = ApplicationInvitationFactory.create(role=app_role)
|
||||
env = EnvironmentFactory.create(application=application)
|
||||
env_role = EnvironmentRoleFactory.create(environment=env, user=app_role.user)
|
||||
env_role = EnvironmentRoleFactory.create(environment=env, application_role=app_role)
|
||||
# add rando app
|
||||
rando_app = ApplicationFactory.create(portfolio=portfolio)
|
||||
|
||||
|
Reference in New Issue
Block a user