|
@@ -116,6 +116,54 @@ class TestHtmlDocuments(FunctionalTest):
|
116
|
116
|
assert content['last_modifier']['avatar_url'] is None
|
117
|
117
|
assert content['raw_content'] == '<p>To cook a great Tiramisu, you need many ingredients.</p>'
|
118
|
118
|
|
|
119
|
+ def test_api__get_html_document__ok_200__archived_content(self) -> None:
|
|
120
|
+ """
|
|
121
|
+ Get one html document of a content
|
|
122
|
+ """
|
|
123
|
+ self.testapp.authorization = (
|
|
124
|
+ 'Basic',
|
|
125
|
+ (
|
|
126
|
+ 'admin@admin.admin',
|
|
127
|
+ 'admin@admin.admin'
|
|
128
|
+ )
|
|
129
|
+ )
|
|
130
|
+ res = self.testapp.put_json(
|
|
131
|
+ '/api/v2/workspaces/2/contents/6/archive',
|
|
132
|
+ status=204
|
|
133
|
+ )
|
|
134
|
+ res = self.testapp.get(
|
|
135
|
+ '/api/v2/workspaces/2/html-documents/6',
|
|
136
|
+ status=200
|
|
137
|
+ )
|
|
138
|
+ content = res.json_body
|
|
139
|
+ assert content['content_type'] == 'html-document'
|
|
140
|
+ assert content['content_id'] == 6
|
|
141
|
+ assert content['is_archived'] is True
|
|
142
|
+
|
|
143
|
+ def test_api__get_html_document__ok_200__deleted_content(self) -> None:
|
|
144
|
+ """
|
|
145
|
+ Get one html document of a content
|
|
146
|
+ """
|
|
147
|
+ self.testapp.authorization = (
|
|
148
|
+ 'Basic',
|
|
149
|
+ (
|
|
150
|
+ 'admin@admin.admin',
|
|
151
|
+ 'admin@admin.admin'
|
|
152
|
+ )
|
|
153
|
+ )
|
|
154
|
+ res = self.testapp.put_json(
|
|
155
|
+ '/api/v2/workspaces/2/contents/6/delete',
|
|
156
|
+ status=204
|
|
157
|
+ )
|
|
158
|
+ res = self.testapp.get(
|
|
159
|
+ '/api/v2/workspaces/2/html-documents/6',
|
|
160
|
+ status=200
|
|
161
|
+ )
|
|
162
|
+ content = res.json_body
|
|
163
|
+ assert content['content_type'] == 'html-document'
|
|
164
|
+ assert content['content_id'] == 6
|
|
165
|
+ assert content['is_deleted'] is True
|
|
166
|
+
|
119
|
167
|
def test_api__get_html_document__err_400__wrong_content_type(self) -> None:
|
120
|
168
|
"""
|
121
|
169
|
Get one html document of a content content 7 is not html_document
|