|
@@ -330,7 +330,6 @@ class TestUserReadStatusEndpoint(FunctionalTest):
|
330
|
330
|
# folder subcontent modification does not change folder order
|
331
|
331
|
assert res[6]['content_id'] == main_folder.content_id
|
332
|
332
|
|
333
|
|
- @pytest.mark.xfail(reason='List of item in path bug need to be fixed')
|
334
|
333
|
def test_api__get_read_status__ok__200__nominal_case(self):
|
335
|
334
|
|
336
|
335
|
# init DB
|
|
@@ -402,20 +401,16 @@ class TestUserReadStatusEndpoint(FunctionalTest):
|
402
|
401
|
firstly_created.content_id,
|
403
|
402
|
main_folder.content_id,
|
404
|
403
|
]
|
405
|
|
-
|
406
|
|
- content_id_str = '[{0},{1},{2},{3}]'.format(
|
407
|
|
- selected_contents_id[0],
|
408
|
|
- selected_contents_id[1],
|
409
|
|
- selected_contents_id[2],
|
410
|
|
- selected_contents_id[3],
|
|
404
|
+ url = '/api/v2/users/1/workspaces/{workspace_id}/contents/read_status?contents_ids={cid1}&contents_ids={cid2}&contents_ids={cid3}&contents_ids={cid4}'.format( # nopep8
|
|
405
|
+ workspace_id=workspace.workspace_id,
|
|
406
|
+ cid1=selected_contents_id[0],
|
|
407
|
+ cid2=selected_contents_id[1],
|
|
408
|
+ cid3=selected_contents_id[2],
|
|
409
|
+ cid4=selected_contents_id[3],
|
411
|
410
|
)
|
412
|
|
- params = {
|
413
|
|
- 'contents_ids': content_id_str
|
414
|
|
- }
|
415
|
411
|
res = self.testapp.get(
|
416
|
|
- '/api/v2/users/1/workspaces/{}/contents/read_status'.format(workspace.workspace_id), # nopep8
|
|
412
|
+ url=url,
|
417
|
413
|
status=200,
|
418
|
|
- params=params
|
419
|
414
|
)
|
420
|
415
|
res = res.json_body
|
421
|
416
|
assert len(res) == 4
|
|
@@ -424,16 +419,13 @@ class TestUserReadStatusEndpoint(FunctionalTest):
|
424
|
419
|
assert isinstance(elem['read_by_user'], bool)
|
425
|
420
|
# comment is newest than page2
|
426
|
421
|
assert res[0]['content_id'] == firstly_created_but_recently_commented.content_id
|
427
|
|
- assert res[1]['content_id'] == secondly_created_but_not_commented.content_id
|
428
|
422
|
# last updated content is newer than other one despite creation
|
429
|
423
|
# of the other is more recent
|
430
|
|
- assert res[2]['content_id'] == firstly_created_but_recently_updated.content_id
|
431
|
|
- assert res[3]['content_id'] == secondly_created_but_not_updated.content_id
|
|
424
|
+ assert res[1]['content_id'] == firstly_created_but_recently_updated.content_id
|
432
|
425
|
# creation order is inverted here as last created is last active
|
433
|
|
- assert res[4]['content_id'] == secondly_created.content_id
|
434
|
|
- assert res[5]['content_id'] == firstly_created.content_id
|
|
426
|
+ assert res[2]['content_id'] == firstly_created.content_id
|
435
|
427
|
# folder subcontent modification does not change folder order
|
436
|
|
- assert res[6]['content_id'] == main_folder.content_id
|
|
428
|
+ assert res[3]['content_id'] == main_folder.content_id
|
437
|
429
|
|
438
|
430
|
|
439
|
431
|
class TestUserSetContentAsRead(FunctionalTest):
|