Skip to content

Commit

Permalink
Fix project tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raethlein committed Apr 25, 2021
1 parent 6be325b commit 002e0a7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions backend/tests/test_project_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,15 @@ def test_list_project(self, faker: Faker) -> None:
)
created_projects_without_user.append(created_project)

assert len(self.project_manager.list_projects()) == len(
created_projects_without_user
# when running the test against an endpoint, list_projects might also return the project belonging to the user which is a technical project
projects = list(
filter(
lambda project: not project.technical_project,
self.project_manager.list_projects(),
)
)
assert len(projects) == len(created_projects_without_user)


# Set an authorized user in the request state
username = faker.simple_profile()["username"]
Expand Down Expand Up @@ -223,7 +229,14 @@ def test_delete_project(self, faker: Faker) -> None:
with pytest.raises(ResourceNotFoundError):
self.project_manager.get_project(created_project.id)

assert len(self.project_manager.list_projects()) == 0
# when running the test against an endpoint, list_projects might also return the project belonging to the user which is a technical project
projects = list(
filter(
lambda project: not project.technical_project,
self.project_manager.list_projects(),
)
)
assert len(projects) == 0

def test_project_member_handling(self, faker: Faker) -> None:
project_name = faker.bs()
Expand Down

0 comments on commit 002e0a7

Please sign in to comment.