|
@@ -27,7 +27,7 @@ class TestWorkspaceEndpoint(FunctionalTest):
|
27
|
27
|
)
|
28
|
28
|
res = self.testapp.get('/api/v2/workspaces/1', status=200)
|
29
|
29
|
workspace = res.json_body
|
30
|
|
- assert workspace['id'] == 1
|
|
30
|
+ assert workspace['workspace_id'] == 1
|
31
|
31
|
assert workspace['slug'] == 'business'
|
32
|
32
|
assert workspace['label'] == 'Business'
|
33
|
33
|
assert workspace['description'] == 'All importants documents'
|
|
@@ -155,10 +155,10 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
155
|
155
|
res = self.testapp.get('/api/v2/workspaces/1/members', status=200).json_body # nopep8
|
156
|
156
|
assert len(res) == 1
|
157
|
157
|
user_role = res[0]
|
158
|
|
- assert user_role['role_slug'] == 'workspace-manager'
|
|
158
|
+ assert user_role['role'] == 'workspace-manager'
|
159
|
159
|
assert user_role['user_id'] == 1
|
160
|
160
|
assert user_role['workspace_id'] == 1
|
161
|
|
- assert user_role['user']['display_name'] == 'Global manager'
|
|
161
|
+ assert user_role['user']['public_name'] == 'Global manager'
|
162
|
162
|
# TODO - G.M - 24-05-2018 - [Avatar] Replace
|
163
|
163
|
# by correct value when avatar feature will be enabled
|
164
|
164
|
assert user_role['user']['avatar_url'] is None
|
|
@@ -239,37 +239,37 @@ class TestWorkspaceContents(FunctionalTest):
|
239
|
239
|
# TODO - G.M - 30-05-2018 - Check this test
|
240
|
240
|
assert len(res) == 3
|
241
|
241
|
content = res[0]
|
242
|
|
- assert content['id'] == 1
|
|
242
|
+ assert content['content_id'] == 1
|
243
|
243
|
assert content['is_archived'] is False
|
244
|
244
|
assert content['is_deleted'] is False
|
245
|
245
|
assert content['label'] == 'Tools'
|
246
|
246
|
assert content['parent_id'] is None
|
247
|
247
|
assert content['show_in_ui'] is True
|
248
|
248
|
assert content['slug'] == 'tools'
|
249
|
|
- assert content['status_slug'] == 'open'
|
250
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
249
|
+ assert content['status'] == 'open'
|
|
250
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
251
|
251
|
assert content['workspace_id'] == 1
|
252
|
252
|
content = res[1]
|
253
|
|
- assert content['id'] == 2
|
|
253
|
+ assert content['content_id'] == 2
|
254
|
254
|
assert content['is_archived'] is False
|
255
|
255
|
assert content['is_deleted'] is False
|
256
|
256
|
assert content['label'] == 'Menus'
|
257
|
257
|
assert content['parent_id'] is None
|
258
|
258
|
assert content['show_in_ui'] is True
|
259
|
259
|
assert content['slug'] == 'menus'
|
260
|
|
- assert content['status_slug'] == 'open'
|
261
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
260
|
+ assert content['status'] == 'open'
|
|
261
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
262
|
262
|
assert content['workspace_id'] == 1
|
263
|
263
|
content = res[2]
|
264
|
|
- assert content['id'] == 11
|
|
264
|
+ assert content['content_id'] == 11
|
265
|
265
|
assert content['is_archived'] is False
|
266
|
266
|
assert content['is_deleted'] is False
|
267
|
267
|
assert content['label'] == 'Current Menu'
|
268
|
268
|
assert content['parent_id'] == 2
|
269
|
269
|
assert content['show_in_ui'] is True
|
270
|
270
|
assert content['slug'] == 'current-menu'
|
271
|
|
- assert content['status_slug'] == 'open'
|
272
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
271
|
+ assert content['status'] == 'open'
|
|
272
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
273
|
273
|
assert content['workspace_id'] == 1
|
274
|
274
|
|
275
|
275
|
# Root related
|
|
@@ -299,42 +299,42 @@ class TestWorkspaceContents(FunctionalTest):
|
299
|
299
|
# TODO - G.M - 30-05-2018 - Check this test
|
300
|
300
|
assert len(res) == 4
|
301
|
301
|
content = res[1]
|
302
|
|
- assert content['content_type_slug'] == 'page'
|
303
|
|
- assert content['id'] == 15
|
|
302
|
+ assert content['content_type'] == 'page'
|
|
303
|
+ assert content['content_id'] == 15
|
304
|
304
|
assert content['is_archived'] is False
|
305
|
305
|
assert content['is_deleted'] is False
|
306
|
306
|
assert content['label'] == 'New Fruit Salad'
|
307
|
307
|
assert content['parent_id'] is None
|
308
|
308
|
assert content['show_in_ui'] is True
|
309
|
309
|
assert content['slug'] == 'new-fruit-salad'
|
310
|
|
- assert content['status_slug'] == 'open'
|
311
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
310
|
+ assert content['status'] == 'open'
|
|
311
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
312
|
312
|
assert content['workspace_id'] == 3
|
313
|
313
|
|
314
|
314
|
content = res[2]
|
315
|
|
- assert content['content_type_slug'] == 'page'
|
316
|
|
- assert content['id'] == 16
|
|
315
|
+ assert content['content_type'] == 'page'
|
|
316
|
+ assert content['content_id'] == 16
|
317
|
317
|
assert content['is_archived'] is True
|
318
|
318
|
assert content['is_deleted'] is False
|
319
|
319
|
assert content['label'].startswith('Fruit Salad')
|
320
|
320
|
assert content['parent_id'] is None
|
321
|
321
|
assert content['show_in_ui'] is True
|
322
|
322
|
assert content['slug'].startswith('fruit-salad')
|
323
|
|
- assert content['status_slug'] == 'open'
|
324
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
323
|
+ assert content['status'] == 'open'
|
|
324
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
325
|
325
|
assert content['workspace_id'] == 3
|
326
|
326
|
|
327
|
327
|
content = res[3]
|
328
|
|
- assert content['content_type_slug'] == 'page'
|
329
|
|
- assert content['id'] == 17
|
|
328
|
+ assert content['content_type'] == 'page'
|
|
329
|
+ assert content['content_id'] == 17
|
330
|
330
|
assert content['is_archived'] is False
|
331
|
331
|
assert content['is_deleted'] is True
|
332
|
332
|
assert content['label'].startswith('Bad Fruit Salad')
|
333
|
333
|
assert content['parent_id'] is None
|
334
|
334
|
assert content['show_in_ui'] is True
|
335
|
335
|
assert content['slug'].startswith('bad-fruit-salad')
|
336
|
|
- assert content['status_slug'] == 'open'
|
337
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
336
|
+ assert content['status'] == 'open'
|
|
337
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
338
|
338
|
assert content['workspace_id'] == 3
|
339
|
339
|
|
340
|
340
|
def test_api__get_workspace_content__ok_200__get_only_active_root_content(self): # nopep8
|
|
@@ -362,16 +362,16 @@ class TestWorkspaceContents(FunctionalTest):
|
362
|
362
|
# TODO - G.M - 30-05-2018 - Check this test
|
363
|
363
|
assert len(res) == 2
|
364
|
364
|
content = res[1]
|
365
|
|
- assert content['content_type_slug'] == 'page'
|
366
|
|
- assert content['id'] == 15
|
|
365
|
+ assert content['content_type'] == 'page'
|
|
366
|
+ assert content['content_id'] == 15
|
367
|
367
|
assert content['is_archived'] is False
|
368
|
368
|
assert content['is_deleted'] is False
|
369
|
369
|
assert content['label'] == 'New Fruit Salad'
|
370
|
370
|
assert content['parent_id'] is None
|
371
|
371
|
assert content['show_in_ui'] is True
|
372
|
372
|
assert content['slug'] == 'new-fruit-salad'
|
373
|
|
- assert content['status_slug'] == 'open'
|
374
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
373
|
+ assert content['status'] == 'open'
|
|
374
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
375
|
375
|
assert content['workspace_id'] == 3
|
376
|
376
|
|
377
|
377
|
def test_api__get_workspace_content__ok_200__get_only_archived_root_content(self): # nopep8
|
|
@@ -398,16 +398,16 @@ class TestWorkspaceContents(FunctionalTest):
|
398
|
398
|
).json_body # nopep8
|
399
|
399
|
assert len(res) == 1
|
400
|
400
|
content = res[0]
|
401
|
|
- assert content['content_type_slug'] == 'page'
|
402
|
|
- assert content['id'] == 16
|
|
401
|
+ assert content['content_type'] == 'page'
|
|
402
|
+ assert content['content_id'] == 16
|
403
|
403
|
assert content['is_archived'] is True
|
404
|
404
|
assert content['is_deleted'] is False
|
405
|
405
|
assert content['label'].startswith('Fruit Salad')
|
406
|
406
|
assert content['parent_id'] is None
|
407
|
407
|
assert content['show_in_ui'] is True
|
408
|
408
|
assert content['slug'].startswith('fruit-salad')
|
409
|
|
- assert content['status_slug'] == 'open'
|
410
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
409
|
+ assert content['status'] == 'open'
|
|
410
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
411
|
411
|
assert content['workspace_id'] == 3
|
412
|
412
|
|
413
|
413
|
def test_api__get_workspace_content__ok_200__get_only_deleted_root_content(self): # nopep8
|
|
@@ -436,16 +436,16 @@ class TestWorkspaceContents(FunctionalTest):
|
436
|
436
|
|
437
|
437
|
assert len(res) == 1
|
438
|
438
|
content = res[0]
|
439
|
|
- assert content['content_type_slug'] == 'page'
|
440
|
|
- assert content['id'] == 17
|
|
439
|
+ assert content['content_type'] == 'page'
|
|
440
|
+ assert content['content_id'] == 17
|
441
|
441
|
assert content['is_archived'] is False
|
442
|
442
|
assert content['is_deleted'] is True
|
443
|
443
|
assert content['label'].startswith('Bad Fruit Salad')
|
444
|
444
|
assert content['parent_id'] is None
|
445
|
445
|
assert content['show_in_ui'] is True
|
446
|
446
|
assert content['slug'].startswith('bad-fruit-salad')
|
447
|
|
- assert content['status_slug'] == 'open'
|
448
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
447
|
+ assert content['status'] == 'open'
|
|
448
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
449
|
449
|
assert content['workspace_id'] == 3
|
450
|
450
|
|
451
|
451
|
def test_api__get_workspace_content__ok_200__get_nothing_root_content(self):
|
|
@@ -500,42 +500,42 @@ class TestWorkspaceContents(FunctionalTest):
|
500
|
500
|
).json_body # nopep8
|
501
|
501
|
assert len(res) == 3
|
502
|
502
|
content = res[0]
|
503
|
|
- assert content['content_type_slug'] == 'page'
|
504
|
|
- assert content['id'] == 12
|
|
503
|
+ assert content['content_type'] == 'page'
|
|
504
|
+ assert content['content_id'] == 12
|
505
|
505
|
assert content['is_archived'] is False
|
506
|
506
|
assert content['is_deleted'] is False
|
507
|
507
|
assert content['label'] == 'New Fruit Salad'
|
508
|
508
|
assert content['parent_id'] == 10
|
509
|
509
|
assert content['show_in_ui'] is True
|
510
|
510
|
assert content['slug'] == 'new-fruit-salad'
|
511
|
|
- assert content['status_slug'] == 'open'
|
512
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
511
|
+ assert content['status'] == 'open'
|
|
512
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
513
|
513
|
assert content['workspace_id'] == 2
|
514
|
514
|
|
515
|
515
|
content = res[1]
|
516
|
|
- assert content['content_type_slug'] == 'page'
|
517
|
|
- assert content['id'] == 13
|
|
516
|
+ assert content['content_type'] == 'page'
|
|
517
|
+ assert content['content_id'] == 13
|
518
|
518
|
assert content['is_archived'] is True
|
519
|
519
|
assert content['is_deleted'] is False
|
520
|
520
|
assert content['label'].startswith('Fruit Salad')
|
521
|
521
|
assert content['parent_id'] == 10
|
522
|
522
|
assert content['show_in_ui'] is True
|
523
|
523
|
assert content['slug'].startswith('fruit-salad')
|
524
|
|
- assert content['status_slug'] == 'open'
|
525
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
524
|
+ assert content['status'] == 'open'
|
|
525
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
526
|
526
|
assert content['workspace_id'] == 2
|
527
|
527
|
|
528
|
528
|
content = res[2]
|
529
|
|
- assert content['content_type_slug'] == 'page'
|
530
|
|
- assert content['id'] == 14
|
|
529
|
+ assert content['content_type'] == 'page'
|
|
530
|
+ assert content['content_id'] == 14
|
531
|
531
|
assert content['is_archived'] is False
|
532
|
532
|
assert content['is_deleted'] is True
|
533
|
533
|
assert content['label'].startswith('Bad Fruit Salad')
|
534
|
534
|
assert content['parent_id'] == 10
|
535
|
535
|
assert content['show_in_ui'] is True
|
536
|
536
|
assert content['slug'].startswith('bad-fruit-salad')
|
537
|
|
- assert content['status_slug'] == 'open'
|
538
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
537
|
+ assert content['status'] == 'open'
|
|
538
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
539
|
539
|
assert content['workspace_id'] == 2
|
540
|
540
|
|
541
|
541
|
def test_api__get_workspace_content__ok_200__get_only_active_folder_content(self): # nopep8
|
|
@@ -562,16 +562,16 @@ class TestWorkspaceContents(FunctionalTest):
|
562
|
562
|
).json_body # nopep8
|
563
|
563
|
assert len(res) == 1
|
564
|
564
|
content = res[0]
|
565
|
|
- assert content['content_type_slug']
|
566
|
|
- assert content['id'] == 12
|
|
565
|
+ assert content['content_type']
|
|
566
|
+ assert content['content_id'] == 12
|
567
|
567
|
assert content['is_archived'] is False
|
568
|
568
|
assert content['is_deleted'] is False
|
569
|
569
|
assert content['label'] == 'New Fruit Salad'
|
570
|
570
|
assert content['parent_id'] == 10
|
571
|
571
|
assert content['show_in_ui'] is True
|
572
|
572
|
assert content['slug'] == 'new-fruit-salad'
|
573
|
|
- assert content['status_slug'] == 'open'
|
574
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
573
|
+ assert content['status'] == 'open'
|
|
574
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
575
|
575
|
assert content['workspace_id'] == 2
|
576
|
576
|
|
577
|
577
|
def test_api__get_workspace_content__ok_200__get_only_archived_folder_content(self): # nopep8
|
|
@@ -598,16 +598,16 @@ class TestWorkspaceContents(FunctionalTest):
|
598
|
598
|
).json_body # nopep8
|
599
|
599
|
assert len(res) == 1
|
600
|
600
|
content = res[0]
|
601
|
|
- assert content['content_type_slug'] == 'page'
|
602
|
|
- assert content['id'] == 13
|
|
601
|
+ assert content['content_type'] == 'page'
|
|
602
|
+ assert content['content_id'] == 13
|
603
|
603
|
assert content['is_archived'] is True
|
604
|
604
|
assert content['is_deleted'] is False
|
605
|
605
|
assert content['label'].startswith('Fruit Salad')
|
606
|
606
|
assert content['parent_id'] == 10
|
607
|
607
|
assert content['show_in_ui'] is True
|
608
|
608
|
assert content['slug'].startswith('fruit-salad')
|
609
|
|
- assert content['status_slug'] == 'open'
|
610
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
609
|
+ assert content['status'] == 'open'
|
|
610
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
611
|
611
|
assert content['workspace_id'] == 2
|
612
|
612
|
|
613
|
613
|
def test_api__get_workspace_content__ok_200__get_only_deleted_folder_content(self): # nopep8
|
|
@@ -635,16 +635,16 @@ class TestWorkspaceContents(FunctionalTest):
|
635
|
635
|
|
636
|
636
|
assert len(res) == 1
|
637
|
637
|
content = res[0]
|
638
|
|
- assert content['content_type_slug'] == 'page'
|
639
|
|
- assert content['id'] == 14
|
|
638
|
+ assert content['content_type'] == 'page'
|
|
639
|
+ assert content['content_id'] == 14
|
640
|
640
|
assert content['is_archived'] is False
|
641
|
641
|
assert content['is_deleted'] is True
|
642
|
642
|
assert content['label'].startswith('Bad Fruit Salad')
|
643
|
643
|
assert content['parent_id'] == 10
|
644
|
644
|
assert content['show_in_ui'] is True
|
645
|
645
|
assert content['slug'].startswith('bad-fruit-salad')
|
646
|
|
- assert content['status_slug'] == 'open'
|
647
|
|
- assert set(content['sub_content_type_slug']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
|
646
|
+ assert content['status'] == 'open'
|
|
647
|
+ assert set(content['sub_content_types']) == {'thread', 'page', 'folder', 'file'} # nopep8
|
648
|
648
|
assert content['workspace_id'] == 2
|
649
|
649
|
|
650
|
650
|
def test_api__get_workspace_content__ok_200__get_nothing_folder_content(self): # nopep8
|
|
@@ -741,7 +741,7 @@ class TestWorkspaceContents(FunctionalTest):
|
741
|
741
|
)
|
742
|
742
|
params = {
|
743
|
743
|
'label': 'GenericCreatedContent',
|
744
|
|
- 'content_type_slug': 'markdownpage',
|
|
744
|
+ 'content_type': 'markdownpage',
|
745
|
745
|
}
|
746
|
746
|
res = self.testapp.post_json(
|
747
|
747
|
'/api/v2/workspaces/1/contents',
|
|
@@ -750,16 +750,16 @@ class TestWorkspaceContents(FunctionalTest):
|
750
|
750
|
)
|
751
|
751
|
assert res
|
752
|
752
|
assert res.json_body
|
753
|
|
- assert res.json_body['status_slug'] == 'open'
|
754
|
|
- assert res.json_body['id']
|
755
|
|
- assert res.json_body['content_type_slug'] == 'markdownpage'
|
|
753
|
+ assert res.json_body['status'] == 'open'
|
|
754
|
+ assert res.json_body['content_id']
|
|
755
|
+ assert res.json_body['content_type'] == 'markdownpage'
|
756
|
756
|
assert res.json_body['is_archived'] is False
|
757
|
757
|
assert res.json_body['is_deleted'] is False
|
758
|
758
|
assert res.json_body['workspace_id'] == 1
|
759
|
759
|
assert res.json_body['slug'] == 'genericcreatedcontent'
|
760
|
760
|
assert res.json_body['parent_id'] is None
|
761
|
761
|
assert res.json_body['show_in_ui'] is True
|
762
|
|
- assert res.json_body['sub_content_type_slug']
|
|
762
|
+ assert res.json_body['sub_content_types']
|
763
|
763
|
params_active = {
|
764
|
764
|
'parent_id': 0,
|
765
|
765
|
'show_archived': 0,
|
|
@@ -801,18 +801,18 @@ class TestWorkspaceContents(FunctionalTest):
|
801
|
801
|
}
|
802
|
802
|
folder1_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_folder1, status=200).json_body # nopep8
|
803
|
803
|
folder2_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_folder2, status=200).json_body # nopep8
|
804
|
|
- assert [content for content in folder1_contents if content['id'] == 8] # nopep8
|
805
|
|
- assert not [content for content in folder2_contents if content['id'] == 8] # nopep8
|
|
804
|
+ assert [content for content in folder1_contents if content['content_id'] == 8] # nopep8
|
|
805
|
+ assert not [content for content in folder2_contents if content['content_id'] == 8] # nopep8
|
806
|
806
|
# TODO - G.M - 2018-06-163 - Check content
|
807
|
807
|
res = self.testapp.put_json(
|
808
|
808
|
'/api/v2/workspaces/2/contents/8/move',
|
809
|
809
|
params=params,
|
810
|
|
- status=200
|
|
810
|
+ status=204
|
811
|
811
|
)
|
812
|
812
|
new_folder1_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_folder1, status=200).json_body # nopep8
|
813
|
813
|
new_folder2_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_folder2, status=200).json_body # nopep8
|
814
|
|
- assert not [content for content in new_folder1_contents if content['id'] == 8] # nopep8
|
815
|
|
- assert [content for content in new_folder2_contents if content['id'] == 8] # nopep8
|
|
814
|
+ assert not [content for content in new_folder1_contents if content['content_id'] == 8] # nopep8
|
|
815
|
+ assert [content for content in new_folder2_contents if content['content_id'] == 8] # nopep8
|
816
|
816
|
|
817
|
817
|
def test_api_put_move_content__ok_200__to_root(self):
|
818
|
818
|
"""
|
|
@@ -1055,18 +1055,18 @@ class TestWorkspaceContents(FunctionalTest):
|
1055
|
1055
|
}
|
1056
|
1056
|
active_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_active, status=200).json_body # nopep8
|
1057
|
1057
|
deleted_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_deleted, status=200).json_body # nopep8
|
1058
|
|
- assert [content for content in active_contents if content['id'] == 8] # nopep8
|
1059
|
|
- assert not [content for content in deleted_contents if content['id'] == 8] # nopep8
|
|
1058
|
+ assert [content for content in active_contents if content['content_id'] == 8] # nopep8
|
|
1059
|
+ assert not [content for content in deleted_contents if content['content_id'] == 8] # nopep8
|
1060
|
1060
|
# TODO - G.M - 2018-06-163 - Check content
|
1061
|
1061
|
res = self.testapp.put_json(
|
1062
|
1062
|
# INFO - G.M - 2018-06-163 - delete Apple_Pie
|
1063
|
1063
|
'/api/v2/workspaces/2/contents/8/delete',
|
1064
|
|
- status=200
|
|
1064
|
+ status=204
|
1065
|
1065
|
)
|
1066
|
1066
|
new_active_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_active, status=200).json_body # nopep8
|
1067
|
1067
|
new_deleted_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_deleted, status=200).json_body # nopep8
|
1068
|
|
- assert not [content for content in new_active_contents if content['id'] == 8] # nopep8
|
1069
|
|
- assert [content for content in new_deleted_contents if content['id'] == 8] # nopep8
|
|
1068
|
+ assert not [content for content in new_active_contents if content['content_id'] == 8] # nopep8
|
|
1069
|
+ assert [content for content in new_deleted_contents if content['content_id'] == 8] # nopep8
|
1070
|
1070
|
|
1071
|
1071
|
def test_api_put_archive_content__ok_200__nominal_case(self):
|
1072
|
1072
|
"""
|
|
@@ -1094,16 +1094,16 @@ class TestWorkspaceContents(FunctionalTest):
|
1094
|
1094
|
}
|
1095
|
1095
|
active_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_active, status=200).json_body # nopep8
|
1096
|
1096
|
archived_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_archived, status=200).json_body # nopep8
|
1097
|
|
- assert [content for content in active_contents if content['id'] == 8] # nopep8
|
1098
|
|
- assert not [content for content in archived_contents if content['id'] == 8] # nopep8
|
|
1097
|
+ assert [content for content in active_contents if content['content_id'] == 8] # nopep8
|
|
1098
|
+ assert not [content for content in archived_contents if content['content_id'] == 8] # nopep8
|
1099
|
1099
|
res = self.testapp.put_json(
|
1100
|
1100
|
'/api/v2/workspaces/2/contents/8/archive',
|
1101
|
|
- status=200
|
|
1101
|
+ status=204
|
1102
|
1102
|
)
|
1103
|
1103
|
new_active_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_active, status=200).json_body # nopep8
|
1104
|
1104
|
new_archived_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_archived, status=200).json_body # nopep8
|
1105
|
|
- assert not [content for content in new_active_contents if content['id'] == 8] # nopep8
|
1106
|
|
- assert [content for content in new_archived_contents if content['id'] == 8] # nopep8
|
|
1105
|
+ assert not [content for content in new_active_contents if content['content_id'] == 8] # nopep8
|
|
1106
|
+ assert [content for content in new_archived_contents if content['content_id'] == 8] # nopep8
|
1107
|
1107
|
|
1108
|
1108
|
def test_api_put_undelete_content__ok_200__nominal_case(self):
|
1109
|
1109
|
"""
|
|
@@ -1131,16 +1131,16 @@ class TestWorkspaceContents(FunctionalTest):
|
1131
|
1131
|
}
|
1132
|
1132
|
active_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_active, status=200).json_body # nopep8
|
1133
|
1133
|
deleted_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_deleted, status=200).json_body # nopep8
|
1134
|
|
- assert not [content for content in active_contents if content['id'] == 14] # nopep8
|
1135
|
|
- assert [content for content in deleted_contents if content['id'] == 14] # nopep8
|
|
1134
|
+ assert not [content for content in active_contents if content['content_id'] == 14] # nopep8
|
|
1135
|
+ assert [content for content in deleted_contents if content['content_id'] == 14] # nopep8
|
1136
|
1136
|
res = self.testapp.put_json(
|
1137
|
1137
|
'/api/v2/workspaces/2/contents/14/undelete',
|
1138
|
|
- status=200
|
|
1138
|
+ status=204
|
1139
|
1139
|
)
|
1140
|
1140
|
new_active_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_active, status=200).json_body # nopep8
|
1141
|
1141
|
new_deleted_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_deleted, status=200).json_body # nopep8
|
1142
|
|
- assert [content for content in new_active_contents if content['id'] == 14] # nopep8
|
1143
|
|
- assert not [content for content in new_deleted_contents if content['id'] == 14] # nopep8
|
|
1142
|
+ assert [content for content in new_active_contents if content['content_id'] == 14] # nopep8
|
|
1143
|
+ assert not [content for content in new_deleted_contents if content['content_id'] == 14] # nopep8
|
1144
|
1144
|
|
1145
|
1145
|
def test_api_put_unarchive_content__ok_200__nominal_case(self):
|
1146
|
1146
|
"""
|
|
@@ -1168,13 +1168,13 @@ class TestWorkspaceContents(FunctionalTest):
|
1168
|
1168
|
}
|
1169
|
1169
|
active_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_active, status=200).json_body # nopep8
|
1170
|
1170
|
archived_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_archived, status=200).json_body # nopep8
|
1171
|
|
- assert not [content for content in active_contents if content['id'] == 13] # nopep8
|
1172
|
|
- assert [content for content in archived_contents if content['id'] == 13] # nopep8
|
|
1171
|
+ assert not [content for content in active_contents if content['content_id'] == 13] # nopep8
|
|
1172
|
+ assert [content for content in archived_contents if content['content_id'] == 13] # nopep8
|
1173
|
1173
|
res = self.testapp.put_json(
|
1174
|
1174
|
'/api/v2/workspaces/2/contents/13/unarchive',
|
1175
|
|
- status=200
|
|
1175
|
+ status=204
|
1176
|
1176
|
)
|
1177
|
1177
|
new_active_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_active, status=200).json_body # nopep8
|
1178
|
1178
|
new_archived_contents = self.testapp.get('/api/v2/workspaces/2/contents', params=params_archived, status=200).json_body # nopep8
|
1179
|
|
- assert [content for content in new_active_contents if content['id'] == 13] # nopep8
|
1180
|
|
- assert not [content for content in new_archived_contents if content['id'] == 13] # nopep8
|
|
1179
|
+ assert [content for content in new_active_contents if content['content_id'] == 13] # nopep8
|
|
1180
|
+ assert not [content for content in new_archived_contents if content['content_id'] == 13] # nopep8
|