@@ -112,3 +112,42 @@ def test_filter_by_user(auth_client_with_refresh, create_user, create_superuser,
112112 sims = response4 .data
113113 assert len (sims ) == 5 , "Length of response list is not 5"
114114 assert sims [0 ] == SimulationStatusSerializer (sim_list2 [0 ]).data , "First Simulation of List response is different from first simulation of list in memory"
115+
116+ def test_filter_by_iterations (auth_client_with_refresh , create_user , create_simulation_list ):
117+ user = create_user (email = "test1@email.com" ,password = "test1password" )
118+ sim_list = create_simulation_list (user = user )
119+
120+ auth_client , _ = auth_client_with_refresh (user = user , password = "test1password" )
121+ url = reverse ("simulation-list" )
122+ response1 = auth_client .get (url , {"iterations" : 10 })
123+
124+ assert response1 .status_code == 200 , "response status code not 200"
125+ sims = response1 .data
126+ assert len (sims ) == 1 , "Length of response list is not 1"
127+ assert sims [0 ] == SimulationStatusSerializer (sim_list [0 ]).data , "First Simulation of List response is different from first simulation of list in memory"
128+
129+ def test_filter_by_cat_amounts (auth_client_with_refresh , create_user , create_simulation_list ):
130+ user = create_user (email = "test1@email.com" ,password = "test1password" )
131+ sim_list = create_simulation_list (user = user )
132+
133+ auth_client , _ = auth_client_with_refresh (user = user , password = "test1password" )
134+ url = reverse ("simulation-list" )
135+ response1 = auth_client .get (url , {"cat_amount" : 6 })
136+
137+ assert response1 .status_code == 200 , "response status code not 200"
138+ sims = response1 .data
139+ assert len (sims ) == 1 , "Length of response list is not 1"
140+ assert sims [0 ] == SimulationStatusSerializer (sim_list [1 ]).data , "First Simulation of List response is different from first simulation of list in memory"
141+
142+ def test_filter_by_node_amounts (auth_client_with_refresh , create_user , create_simulation_list ):
143+ user = create_user (email = "test1@email.com" ,password = "test1password" )
144+ sim_list = create_simulation_list (user = user )
145+
146+ auth_client , _ = auth_client_with_refresh (user = user , password = "test1password" )
147+ url = reverse ("simulation-list" )
148+ response1 = auth_client .get (url , {"node_amount" : 10 })
149+
150+ assert response1 .status_code == 200 , "response status code not 200"
151+ sims = response1 .data
152+ assert len (sims ) == 1 , "Length of response list is not 1"
153+ assert sims [0 ] == SimulationStatusSerializer (sim_list [1 ]).data , "First Simulation of List response is different from first simulation of list in memory"
0 commit comments