@@ -159,11 +159,11 @@ def test_list_multisite(db, client, settings):
159159 visibility .sites .add (Site .objects .get (id = 1 ))
160160
161161 url = reverse (urlnames ['list' ])
162- response = client .get (url + '?page=3' )
162+ response = client .get (url )
163163 response_data = response .json ()
164164
165165 assert response .status_code == 200
166- assert project .id in [ i [ 'id' ] for i in response_data [ 'results' ] ]
166+ assert project .id == response_data [ 'results' ][ 0 ][ 'id' ]
167167 assert response_data ['count' ] == len (view_project_permission_map ['site' ]) + 1
168168
169169
@@ -374,18 +374,24 @@ def test_copy(db, files, client, username, password, project_id):
374374 'title' : 'New title' ,
375375 'description' : project .description ,
376376 'catalog' : project .catalog .id ,
377- 'tasks' : list ( project . tasks . values_list ( 'id' , flat = True )) , # will be ignored but should not crash
378- 'views' : list ( project . views . values_list ( 'id' , flat = True )) , # will be ignored but should not crash
377+ 'tasks' : [ 2 ] , # will be ignored but should not crash
378+ 'views' : [ 2 ] , # will be ignored but should not crash
379379 }
380380 response = client .post (url , data , content_type = 'application/json' )
381381
382382 if project_id in view_project_permission_map .get (username , []):
383383 assert response .status_code == 201
384384
385385 for key , value in response .json ().items ():
386- if key in data :
386+ if key in [ 'title' , 'description' , 'catalog' ] :
387387 assert value == data [key ]
388388
389+ # TODO: add checks once rdmo.project.handlers is rebased
390+ # elif key == 'tasks':
391+ # assert value == list(project.tasks.values_list('id', flat=True))
392+ # elif key == 'views':
393+ # assert value == list(project.views.values_list('id', flat=True))
394+
389395 assert Project .objects .count () == project_count + 1
390396 assert Snapshot .objects .count () == snapshot_count + project_snapshots_count
391397 assert Value .objects .count () == value_count + project_values_count
0 commit comments