|
@@ -834,6 +834,49 @@ class TestWorkspaceContents(FunctionalTest):
|
834
|
834
|
active_contents = self.testapp.get('/api/v2/workspaces/1/contents', params=params_active, status=200).json_body # nopep8
|
835
|
835
|
assert res.json_body in active_contents
|
836
|
836
|
|
|
837
|
+ def test_api__post_content_create_generic_content__ok_200__in_folder(self) -> None: # nopep8
|
|
838
|
+ """
|
|
839
|
+ Create generic content in folder
|
|
840
|
+ """
|
|
841
|
+ self.testapp.authorization = (
|
|
842
|
+ 'Basic',
|
|
843
|
+ (
|
|
844
|
+ 'admin@admin.admin',
|
|
845
|
+ 'admin@admin.admin'
|
|
846
|
+ )
|
|
847
|
+ )
|
|
848
|
+ params = {
|
|
849
|
+ 'label': 'GenericCreatedContent',
|
|
850
|
+ 'content_type': 'markdownpage',
|
|
851
|
+ 'parent_id': 10,
|
|
852
|
+ }
|
|
853
|
+ res = self.testapp.post_json(
|
|
854
|
+ '/api/v2/workspaces/1/contents',
|
|
855
|
+ params=params,
|
|
856
|
+ status=200
|
|
857
|
+ )
|
|
858
|
+ assert res
|
|
859
|
+ assert res.json_body
|
|
860
|
+ assert res.json_body['status'] == 'open'
|
|
861
|
+ assert res.json_body['content_id']
|
|
862
|
+ assert res.json_body['content_type'] == 'markdownpage'
|
|
863
|
+ assert res.json_body['is_archived'] is False
|
|
864
|
+ assert res.json_body['is_deleted'] is False
|
|
865
|
+ assert res.json_body['workspace_id'] == 1
|
|
866
|
+ assert res.json_body['slug'] == 'genericcreatedcontent'
|
|
867
|
+ assert res.json_body['parent_id'] == 10
|
|
868
|
+ assert res.json_body['show_in_ui'] is True
|
|
869
|
+ assert res.json_body['sub_content_types']
|
|
870
|
+ params_active = {
|
|
871
|
+ 'parent_id': 10,
|
|
872
|
+ 'show_archived': 0,
|
|
873
|
+ 'show_deleted': 0,
|
|
874
|
+ 'show_active': 1,
|
|
875
|
+ }
|
|
876
|
+ # INFO - G.M - 2018-06-165 - Verify if new content is correctly created
|
|
877
|
+ active_contents = self.testapp.get('/api/v2/workspaces/1/contents', params=params_active, status=200).json_body # nopep8
|
|
878
|
+ assert res.json_body in active_contents
|
|
879
|
+
|
837
|
880
|
def test_api__post_content_create_generic_content__err_400__empty_label(self) -> None: # nopep8
|
838
|
881
|
"""
|
839
|
882
|
Create generic content
|