Automatically assign workspace owner to environments
This commit is contained in:
@@ -4,7 +4,7 @@ from tests.factories import WorkspaceFactory
|
||||
|
||||
def test_create_project_with_multiple_environments():
|
||||
workspace = WorkspaceFactory.create()
|
||||
project = Projects.create(workspace, "My Test Project", "Test", ["dev", "prod"])
|
||||
project = Projects.create(workspace.owner, workspace, "My Test Project", "Test", ["dev", "prod"])
|
||||
|
||||
assert project.workspace == workspace
|
||||
assert project.name == "My Test Project"
|
||||
|
@@ -10,7 +10,7 @@ def test_add_user_to_environment():
|
||||
|
||||
workspace = Workspaces.create(RequestFactory.create(creator=owner))
|
||||
project = Projects.create(
|
||||
workspace, "my test project", "It's mine.", ["dev", "staging", "prod"]
|
||||
owner, workspace, "my test project", "It's mine.", ["dev", "staging", "prod"]
|
||||
)
|
||||
dev_environment = project.environments[0]
|
||||
|
||||
|
@@ -33,7 +33,7 @@ def test_has_environment_roles():
|
||||
workspace = Workspaces.create(RequestFactory.create(creator=owner))
|
||||
workspace_user = Workspaces.create_member(owner, workspace, developer_data)
|
||||
project = Projects.create(
|
||||
workspace, "my test project", "It's mine.", ["dev", "staging", "prod"]
|
||||
owner, workspace, "my test project", "It's mine.", ["dev", "staging", "prod"]
|
||||
)
|
||||
Environments.add_member(owner, project.environments[0], workspace_user.user)
|
||||
assert workspace_user.has_environment_roles
|
||||
|
Reference in New Issue
Block a user