@@ -145,9 +145,15 @@ def test_list_project(self, faker: Faker) -> None:
145145 )
146146 created_projects_without_user .append (created_project )
147147
148- assert len (self .project_manager .list_projects ()) == len (
149- created_projects_without_user
148+ # when running the test against an endpoint, list_projects might also return the project belonging to the user which is a technical project
149+ projects = list (
150+ filter (
151+ lambda project : not project .technical_project ,
152+ self .project_manager .list_projects (),
153+ )
150154 )
155+ assert len (projects ) == len (created_projects_without_user )
156+
151157
152158 # Set an authorized user in the request state
153159 username = faker .simple_profile ()["username" ]
@@ -223,7 +229,14 @@ def test_delete_project(self, faker: Faker) -> None:
223229 with pytest .raises (ResourceNotFoundError ):
224230 self .project_manager .get_project (created_project .id )
225231
226- assert len (self .project_manager .list_projects ()) == 0
232+ # when running the test against an endpoint, list_projects might also return the project belonging to the user which is a technical project
233+ projects = list (
234+ filter (
235+ lambda project : not project .technical_project ,
236+ self .project_manager .list_projects (),
237+ )
238+ )
239+ assert len (projects ) == 0
227240
228241 def test_project_member_handling (self , faker : Faker ) -> None :
229242 project_name = faker .bs ()
0 commit comments