Fix regression in Projects.create
A new project's creator was not being assigned a role in the project's environments.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from atst.domain.projects import Projects
|
||||
from tests.factories import RequestFactory
|
||||
from tests.factories import RequestFactory, UserFactory
|
||||
from atst.domain.workspaces import Workspaces
|
||||
|
||||
|
||||
@@ -14,3 +14,16 @@ def test_create_project_with_multiple_environments():
|
||||
assert project.name == "My Test Project"
|
||||
assert project.description == "Test"
|
||||
assert sorted(e.name for e in project.environments) == ["dev", "prod"]
|
||||
|
||||
|
||||
def test_project_creator_has_environment_access():
|
||||
owner = UserFactory.create()
|
||||
request = RequestFactory.create(creator=owner)
|
||||
workspace = Workspaces.create(request)
|
||||
project = Projects.create(
|
||||
owner, workspace, "My Test Project", "Test", ["dev", "prod"]
|
||||
)
|
||||
|
||||
environment = project.environments[0]
|
||||
|
||||
assert owner in environment.users
|
||||
|
Reference in New Issue
Block a user