|
@@ -1436,6 +1436,7 @@ class TestWorkspaceContents(FunctionalTest):
|
1436
|
1436
|
)
|
1437
|
1437
|
)
|
1438
|
1438
|
params = {
|
|
1439
|
+ 'parent_id': None,
|
1439
|
1440
|
'label': 'GenericCreatedContent',
|
1440
|
1441
|
'content_type': 'markdownpage',
|
1441
|
1442
|
}
|
|
@@ -1466,6 +1467,70 @@ class TestWorkspaceContents(FunctionalTest):
|
1466
|
1467
|
active_contents = self.testapp.get('/api/v2/workspaces/1/contents', params=params_active, status=200).json_body # nopep8
|
1467
|
1468
|
assert res.json_body in active_contents
|
1468
|
1469
|
|
|
1470
|
+ def test_api__post_content_create_generic_content__ok_200__no_parent_id_param(self) -> None: # nopep8
|
|
1471
|
+ """
|
|
1472
|
+ Create generic content
|
|
1473
|
+ """
|
|
1474
|
+ self.testapp.authorization = (
|
|
1475
|
+ 'Basic',
|
|
1476
|
+ (
|
|
1477
|
+ 'admin@admin.admin',
|
|
1478
|
+ 'admin@admin.admin'
|
|
1479
|
+ )
|
|
1480
|
+ )
|
|
1481
|
+ params = {
|
|
1482
|
+ 'label': 'GenericCreatedContent',
|
|
1483
|
+ 'content_type': 'markdownpage',
|
|
1484
|
+ }
|
|
1485
|
+ res = self.testapp.post_json(
|
|
1486
|
+ '/api/v2/workspaces/1/contents',
|
|
1487
|
+ params=params,
|
|
1488
|
+ status=200
|
|
1489
|
+ )
|
|
1490
|
+ assert res
|
|
1491
|
+ assert res.json_body
|
|
1492
|
+ assert res.json_body['status'] == 'open'
|
|
1493
|
+ assert res.json_body['content_id']
|
|
1494
|
+ assert res.json_body['content_type'] == 'markdownpage'
|
|
1495
|
+ assert res.json_body['is_archived'] is False
|
|
1496
|
+ assert res.json_body['is_deleted'] is False
|
|
1497
|
+ assert res.json_body['workspace_id'] == 1
|
|
1498
|
+ assert res.json_body['slug'] == 'genericcreatedcontent'
|
|
1499
|
+ assert res.json_body['parent_id'] is None
|
|
1500
|
+ assert res.json_body['show_in_ui'] is True
|
|
1501
|
+ assert res.json_body['sub_content_types']
|
|
1502
|
+ params_active = {
|
|
1503
|
+ 'parent_id': 0,
|
|
1504
|
+ 'show_archived': 0,
|
|
1505
|
+ 'show_deleted': 0,
|
|
1506
|
+ 'show_active': 1,
|
|
1507
|
+ }
|
|
1508
|
+ # INFO - G.M - 2018-06-165 - Verify if new content is correctly created
|
|
1509
|
+ active_contents = self.testapp.get('/api/v2/workspaces/1/contents', params=params_active, status=200).json_body # nopep8
|
|
1510
|
+ assert res.json_body in active_contents
|
|
1511
|
+
|
|
1512
|
+ def test_api__post_content_create_generic_content__err_400__parent_id_0(self) -> None: # nopep8
|
|
1513
|
+ """
|
|
1514
|
+ Create generic content
|
|
1515
|
+ """
|
|
1516
|
+ self.testapp.authorization = (
|
|
1517
|
+ 'Basic',
|
|
1518
|
+ (
|
|
1519
|
+ 'admin@admin.admin',
|
|
1520
|
+ 'admin@admin.admin'
|
|
1521
|
+ )
|
|
1522
|
+ )
|
|
1523
|
+ params = {
|
|
1524
|
+ 'parent_id': 0,
|
|
1525
|
+ 'label': 'GenericCreatedContent',
|
|
1526
|
+ 'content_type': 'markdownpage',
|
|
1527
|
+ }
|
|
1528
|
+ res = self.testapp.post_json(
|
|
1529
|
+ '/api/v2/workspaces/1/contents',
|
|
1530
|
+ params=params,
|
|
1531
|
+ status=400
|
|
1532
|
+ )
|
|
1533
|
+
|
1469
|
1534
|
def test_api__post_content_create_generic_content__ok_200__in_folder(self) -> None: # nopep8
|
1470
|
1535
|
"""
|
1471
|
1536
|
Create generic content in folder
|