|
@@ -1,7 +1,6 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
2
|
2
|
import io
|
3
|
3
|
|
4
|
|
-import pytest
|
5
|
4
|
import transaction
|
6
|
5
|
from PIL import Image
|
7
|
6
|
from depot.io.utils import FileIntent
|
|
@@ -121,7 +120,7 @@ class TestHtmlDocuments(FunctionalTest):
|
121
|
120
|
'admin@admin.admin'
|
122
|
121
|
)
|
123
|
122
|
)
|
124
|
|
- res = self.testapp.get(
|
|
123
|
+ self.testapp.get(
|
125
|
124
|
'/api/v2/workspaces/2/html-documents/7',
|
126
|
125
|
status=400
|
127
|
126
|
)
|
|
@@ -137,7 +136,7 @@ class TestHtmlDocuments(FunctionalTest):
|
137
|
136
|
'admin@admin.admin'
|
138
|
137
|
)
|
139
|
138
|
)
|
140
|
|
- res = self.testapp.get(
|
|
139
|
+ self.testapp.get(
|
141
|
140
|
'/api/v2/workspaces/2/html-documents/170',
|
142
|
141
|
status=400
|
143
|
142
|
)
|
|
@@ -153,7 +152,7 @@ class TestHtmlDocuments(FunctionalTest):
|
153
|
152
|
'admin@admin.admin'
|
154
|
153
|
)
|
155
|
154
|
)
|
156
|
|
- res = self.testapp.get(
|
|
155
|
+ self.testapp.get(
|
157
|
156
|
'/api/v2/workspaces/1/html-documents/6',
|
158
|
157
|
status=400
|
159
|
158
|
)
|
|
@@ -169,7 +168,7 @@ class TestHtmlDocuments(FunctionalTest):
|
169
|
168
|
'admin@admin.admin'
|
170
|
169
|
)
|
171
|
170
|
)
|
172
|
|
- res = self.testapp.get(
|
|
171
|
+ self.testapp.get(
|
173
|
172
|
'/api/v2/workspaces/40/html-documents/6',
|
174
|
173
|
status=400
|
175
|
174
|
)
|
|
@@ -185,7 +184,7 @@ class TestHtmlDocuments(FunctionalTest):
|
185
|
184
|
'admin@admin.admin'
|
186
|
185
|
)
|
187
|
186
|
)
|
188
|
|
- res = self.testapp.get(
|
|
187
|
+ self.testapp.get(
|
189
|
188
|
'/api/v2/workspaces/coucou/html-documents/6',
|
190
|
189
|
status=400
|
191
|
190
|
)
|
|
@@ -201,7 +200,7 @@ class TestHtmlDocuments(FunctionalTest):
|
201
|
200
|
'admin@admin.admin'
|
202
|
201
|
)
|
203
|
202
|
)
|
204
|
|
- res = self.testapp.get(
|
|
203
|
+ self.testapp.get(
|
205
|
204
|
'/api/v2/workspaces/2/html-documents/coucou',
|
206
|
205
|
status=400
|
207
|
206
|
)
|
|
@@ -221,7 +220,7 @@ class TestHtmlDocuments(FunctionalTest):
|
221
|
220
|
'label': '',
|
222
|
221
|
'raw_content': '<p> Le nouveau contenu </p>',
|
223
|
222
|
}
|
224
|
|
- res = self.testapp.put_json(
|
|
223
|
+ self.testapp.put_json(
|
225
|
224
|
'/api/v2/workspaces/2/html-documents/6',
|
226
|
225
|
params=params,
|
227
|
226
|
status=400
|
|
@@ -406,7 +405,7 @@ class TestHtmlDocuments(FunctionalTest):
|
406
|
405
|
assert content['status'] == 'open'
|
407
|
406
|
|
408
|
407
|
# set status
|
409
|
|
- res = self.testapp.put_json(
|
|
408
|
+ self.testapp.put_json(
|
410
|
409
|
'/api/v2/workspaces/2/html-documents/6/status',
|
411
|
410
|
params=params,
|
412
|
411
|
status=204
|
|
@@ -436,7 +435,7 @@ class TestHtmlDocuments(FunctionalTest):
|
436
|
435
|
params = {
|
437
|
436
|
'status': 'unexistant-status',
|
438
|
437
|
}
|
439
|
|
- res = self.testapp.put_json(
|
|
438
|
+ self.testapp.put_json(
|
440
|
439
|
'/api/v2/workspaces/2/html-documents/6/status',
|
441
|
440
|
params=params,
|
442
|
441
|
status=400
|
|
@@ -534,7 +533,7 @@ class TestFiles(FunctionalTest):
|
534
|
533
|
'admin@admin.admin'
|
535
|
534
|
)
|
536
|
535
|
)
|
537
|
|
- res = self.testapp.get(
|
|
536
|
+ self.testapp.get(
|
538
|
537
|
'/api/v2/workspaces/2/files/6',
|
539
|
538
|
status=400
|
540
|
539
|
)
|
|
@@ -550,7 +549,7 @@ class TestFiles(FunctionalTest):
|
550
|
549
|
'admin@admin.admin'
|
551
|
550
|
)
|
552
|
551
|
)
|
553
|
|
- res = self.testapp.get(
|
|
552
|
+ self.testapp.get(
|
554
|
553
|
'/api/v2/workspaces/1/files/170',
|
555
|
554
|
status=400
|
556
|
555
|
)
|
|
@@ -566,7 +565,7 @@ class TestFiles(FunctionalTest):
|
566
|
565
|
'admin@admin.admin'
|
567
|
566
|
)
|
568
|
567
|
)
|
569
|
|
- res = self.testapp.get(
|
|
568
|
+ self.testapp.get(
|
570
|
569
|
'/api/v2/workspaces/1/files/9',
|
571
|
570
|
status=400
|
572
|
571
|
)
|
|
@@ -582,7 +581,7 @@ class TestFiles(FunctionalTest):
|
582
|
581
|
'admin@admin.admin'
|
583
|
582
|
)
|
584
|
583
|
)
|
585
|
|
- res = self.testapp.get(
|
|
584
|
+ self.testapp.get(
|
586
|
585
|
'/api/v2/workspaces/40/files/9',
|
587
|
586
|
status=400
|
588
|
587
|
)
|
|
@@ -598,7 +597,7 @@ class TestFiles(FunctionalTest):
|
598
|
597
|
'admin@admin.admin'
|
599
|
598
|
)
|
600
|
599
|
)
|
601
|
|
- res = self.testapp.get(
|
|
600
|
+ self.testapp.get(
|
602
|
601
|
'/api/v2/workspaces/coucou/files/9',
|
603
|
602
|
status=400
|
604
|
603
|
)
|
|
@@ -614,7 +613,7 @@ class TestFiles(FunctionalTest):
|
614
|
613
|
'admin@admin.admin'
|
615
|
614
|
)
|
616
|
615
|
)
|
617
|
|
- res = self.testapp.get(
|
|
616
|
+ self.testapp.get(
|
618
|
617
|
'/api/v2/workspaces/2/files/coucou',
|
619
|
618
|
status=400
|
620
|
619
|
)
|
|
@@ -668,7 +667,7 @@ class TestFiles(FunctionalTest):
|
668
|
667
|
'label': '',
|
669
|
668
|
'raw_content': '<p> Le nouveau contenu </p>',
|
670
|
669
|
}
|
671
|
|
- res = self.testapp.put_json(
|
|
670
|
+ self.testapp.put_json(
|
672
|
671
|
'/api/v2/workspaces/1/files/{}'.format(test_file.content_id),
|
673
|
672
|
params=params,
|
674
|
673
|
status=400
|
|
@@ -826,7 +825,7 @@ class TestFiles(FunctionalTest):
|
826
|
825
|
)
|
827
|
826
|
)
|
828
|
827
|
res = self.testapp.get(
|
829
|
|
- '/api/v2/workspaces/1/files/{}/revisions'.format(test_file.content_id),
|
|
828
|
+ '/api/v2/workspaces/1/files/{}/revisions'.format(test_file.content_id), # nopep8
|
830
|
829
|
status=200
|
831
|
830
|
)
|
832
|
831
|
revisions = res.json_body
|
|
@@ -913,7 +912,7 @@ class TestFiles(FunctionalTest):
|
913
|
912
|
assert content['status'] == 'open'
|
914
|
913
|
|
915
|
914
|
# set status
|
916
|
|
- res = self.testapp.put_json(
|
|
915
|
+ self.testapp.put_json(
|
917
|
916
|
'/api/v2/workspaces/1/files/{}/status'.format(test_file.content_id),
|
918
|
917
|
params=params,
|
919
|
918
|
status=204
|
|
@@ -943,7 +942,7 @@ class TestFiles(FunctionalTest):
|
943
|
942
|
params = {
|
944
|
943
|
'status': 'unexistant-status',
|
945
|
944
|
}
|
946
|
|
- res = self.testapp.put_json(
|
|
945
|
+ self.testapp.put_json(
|
947
|
946
|
'/api/v2/workspaces/2/files/6/status',
|
948
|
947
|
params=params,
|
949
|
948
|
status=400
|
|
@@ -1041,10 +1040,10 @@ class TestFiles(FunctionalTest):
|
1041
|
1040
|
'admin@admin.admin'
|
1042
|
1041
|
)
|
1043
|
1042
|
)
|
1044
|
|
- res = self.testapp.put(
|
|
1043
|
+ self.testapp.put(
|
1045
|
1044
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1046
|
1045
|
upload_files=[
|
1047
|
|
- ('files',image.name, image.getvalue())
|
|
1046
|
+ ('files', image.name, image.getvalue())
|
1048
|
1047
|
],
|
1049
|
1048
|
status=204,
|
1050
|
1049
|
)
|
|
@@ -1098,11 +1097,11 @@ class TestFiles(FunctionalTest):
|
1098
|
1097
|
)
|
1099
|
1098
|
content_id = int(test_file.content_id)
|
1100
|
1099
|
res = self.testapp.get(
|
1101
|
|
- '/api/v2/workspaces/1/files/{}/preview/jpg/allowed_dims'.format(content_id),
|
|
1100
|
+ '/api/v2/workspaces/1/files/{}/preview/jpg/allowed_dims'.format(content_id), # nopep8
|
1102
|
1101
|
status=200,
|
1103
|
1102
|
)
|
1104
|
1103
|
res = res.json_body
|
1105
|
|
- assert res['restricted'] == True
|
|
1104
|
+ assert res['restricted'] is True
|
1106
|
1105
|
assert len(res['dimensions']) == 1
|
1107
|
1106
|
dim = res['dimensions'][0]
|
1108
|
1107
|
assert dim['width'] == 256
|
|
@@ -1153,7 +1152,7 @@ class TestFiles(FunctionalTest):
|
1153
|
1152
|
'admin@admin.admin'
|
1154
|
1153
|
)
|
1155
|
1154
|
)
|
1156
|
|
- res = self.testapp.put(
|
|
1155
|
+ self.testapp.put(
|
1157
|
1156
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1158
|
1157
|
upload_files=[
|
1159
|
1158
|
('files', image.name, image.getvalue())
|
|
@@ -1206,15 +1205,15 @@ class TestFiles(FunctionalTest):
|
1206
|
1205
|
'admin@admin.admin'
|
1207
|
1206
|
)
|
1208
|
1207
|
)
|
1209
|
|
- res = self.testapp.put(
|
|
1208
|
+ self.testapp.put(
|
1210
|
1209
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1211
|
1210
|
upload_files=[
|
1212
|
|
- ('files',image.name, image.getvalue())
|
|
1211
|
+ ('files', image.name, image.getvalue())
|
1213
|
1212
|
],
|
1214
|
1213
|
status=204,
|
1215
|
1214
|
)
|
1216
|
1215
|
res = self.testapp.get(
|
1217
|
|
- '/api/v2/workspaces/1/files/{}/preview/jpg/256x256'.format(content_id), # nopep8
|
|
1216
|
+ '/api/v2/workspaces/1/files/{}/preview/jpg/256x256'.format(content_id), # nopep8
|
1218
|
1217
|
status=200
|
1219
|
1218
|
)
|
1220
|
1219
|
assert res.body != image.getvalue()
|
|
@@ -1222,7 +1221,7 @@ class TestFiles(FunctionalTest):
|
1222
|
1221
|
new_image = Image.open(io.BytesIO(res.body))
|
1223
|
1222
|
assert 256, 256 == new_image.size
|
1224
|
1223
|
|
1225
|
|
- def test_api__get_sized_jpeg_preview__err__400__SizeNotAllowed(self) -> None:
|
|
1224
|
+ def test_api__get_sized_jpeg_preview__err__400__SizeNotAllowed(self) -> None: # nopep8
|
1226
|
1225
|
"""
|
1227
|
1226
|
get 256x256 preview of a txt file
|
1228
|
1227
|
"""
|
|
@@ -1261,19 +1260,19 @@ class TestFiles(FunctionalTest):
|
1261
|
1260
|
'admin@admin.admin'
|
1262
|
1261
|
)
|
1263
|
1262
|
)
|
1264
|
|
- res = self.testapp.put(
|
|
1263
|
+ self.testapp.put(
|
1265
|
1264
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1266
|
1265
|
upload_files=[
|
1267
|
|
- ('files',image.name, image.getvalue())
|
|
1266
|
+ ('files', image.name, image.getvalue())
|
1268
|
1267
|
],
|
1269
|
1268
|
status=204,
|
1270
|
1269
|
)
|
1271
|
|
- res = self.testapp.get(
|
|
1270
|
+ self.testapp.get(
|
1272
|
1271
|
'/api/v2/workspaces/1/files/{}/preview/jpg/512x512'.format(content_id), # nopep8
|
1273
|
1272
|
status=400
|
1274
|
1273
|
)
|
1275
|
1274
|
|
1276
|
|
- def test_api__get_sized_jpeg_revision_preview__ok__200__nominal_case(self) -> None:
|
|
1275
|
+ def test_api__get_sized_jpeg_revision_preview__ok__200__nominal_case(self) -> None: # nopep8
|
1277
|
1276
|
"""
|
1278
|
1277
|
get 256x256 revision preview of a txt file
|
1279
|
1278
|
"""
|
|
@@ -1319,7 +1318,7 @@ class TestFiles(FunctionalTest):
|
1319
|
1318
|
'admin@admin.admin'
|
1320
|
1319
|
)
|
1321
|
1320
|
)
|
1322
|
|
- res = self.testapp.put(
|
|
1321
|
+ self.testapp.put(
|
1323
|
1322
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1324
|
1323
|
upload_files=[
|
1325
|
1324
|
('files', image.name, image.getvalue())
|
|
@@ -1327,7 +1326,7 @@ class TestFiles(FunctionalTest):
|
1327
|
1326
|
status=204,
|
1328
|
1327
|
)
|
1329
|
1328
|
res = self.testapp.get(
|
1330
|
|
- '/api/v2/workspaces/1/files/{content_id}/revisions/{revision_id}/raw'.format(
|
|
1329
|
+ '/api/v2/workspaces/1/files/{content_id}/revisions/{revision_id}/raw'.format( # nopep8
|
1331
|
1330
|
content_id=content_id,
|
1332
|
1331
|
revision_id=revision_id,
|
1333
|
1332
|
),
|
|
@@ -1335,7 +1334,7 @@ class TestFiles(FunctionalTest):
|
1335
|
1334
|
)
|
1336
|
1335
|
assert res.content_type == 'text/plain'
|
1337
|
1336
|
res = self.testapp.get(
|
1338
|
|
- '/api/v2/workspaces/1/files/{content_id}/revisions/{revision_id}/preview/jpg/256x256'.format(
|
|
1337
|
+ '/api/v2/workspaces/1/files/{content_id}/revisions/{revision_id}/preview/jpg/256x256'.format( # nopep8
|
1339
|
1338
|
content_id=content_id,
|
1340
|
1339
|
revision_id=revision_id,
|
1341
|
1340
|
),
|
|
@@ -1385,7 +1384,7 @@ class TestFiles(FunctionalTest):
|
1385
|
1384
|
'Test_file.txt',
|
1386
|
1385
|
'text/plain',
|
1387
|
1386
|
)
|
1388
|
|
- content_api.update_content(test_file, 'Test_file', '<p>description</p>')
|
|
1387
|
+ content_api.update_content(test_file, 'Test_file', '<p>description</p>') # nopep8
|
1389
|
1388
|
dbsession.flush()
|
1390
|
1389
|
transaction.commit()
|
1391
|
1390
|
content_id = int(test_file.content_id)
|
|
@@ -1396,7 +1395,7 @@ class TestFiles(FunctionalTest):
|
1396
|
1395
|
'admin@admin.admin'
|
1397
|
1396
|
)
|
1398
|
1397
|
)
|
1399
|
|
- res = self.testapp.put(
|
|
1398
|
+ self.testapp.put(
|
1400
|
1399
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1401
|
1400
|
upload_files=[
|
1402
|
1401
|
('files', test_file.file_name, test_file.depot_file.file.read())
|
|
@@ -1404,12 +1403,12 @@ class TestFiles(FunctionalTest):
|
1404
|
1403
|
status=204,
|
1405
|
1404
|
)
|
1406
|
1405
|
res = self.testapp.get(
|
1407
|
|
- '/api/v2/workspaces/1/files/{}/preview/pdf/full'.format(content_id), # nopep8
|
|
1406
|
+ '/api/v2/workspaces/1/files/{}/preview/pdf/full'.format(content_id), # nopep8
|
1408
|
1407
|
status=200
|
1409
|
1408
|
)
|
1410
|
1409
|
assert res.content_type == 'application/pdf'
|
1411
|
1410
|
|
1412
|
|
- def test_api__get_full_pdf_preview__err__400__png_UnavailablePreviewType(self) -> None:
|
|
1411
|
+ def test_api__get_full_pdf_preview__err__400__png_UnavailablePreviewType(self) -> None: # nopep8
|
1413
|
1412
|
"""
|
1414
|
1413
|
get full pdf preview of a png image -> error UnavailablePreviewType
|
1415
|
1414
|
"""
|
|
@@ -1448,15 +1447,15 @@ class TestFiles(FunctionalTest):
|
1448
|
1447
|
'admin@admin.admin'
|
1449
|
1448
|
)
|
1450
|
1449
|
)
|
1451
|
|
- res = self.testapp.put(
|
|
1450
|
+ self.testapp.put(
|
1452
|
1451
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1453
|
1452
|
upload_files=[
|
1454
|
|
- ('files',image.name, image.getvalue())
|
|
1453
|
+ ('files', image.name, image.getvalue())
|
1455
|
1454
|
],
|
1456
|
1455
|
status=204,
|
1457
|
1456
|
)
|
1458
|
|
- res = self.testapp.get(
|
1459
|
|
- '/api/v2/workspaces/1/files/{}/preview/pdf/full'.format(content_id), # nopep8
|
|
1457
|
+ self.testapp.get(
|
|
1458
|
+ '/api/v2/workspaces/1/files/{}/preview/pdf/full'.format(content_id), # nopep8
|
1460
|
1459
|
status=400
|
1461
|
1460
|
)
|
1462
|
1461
|
|
|
@@ -1499,7 +1498,7 @@ class TestFiles(FunctionalTest):
|
1499
|
1498
|
'Test_file.txt',
|
1500
|
1499
|
'text/plain',
|
1501
|
1500
|
)
|
1502
|
|
- content_api.update_content(test_file, 'Test_file', '<p>description</p>')
|
|
1501
|
+ content_api.update_content(test_file, 'Test_file', '<p>description</p>') # nopep8
|
1503
|
1502
|
dbsession.flush()
|
1504
|
1503
|
transaction.commit()
|
1505
|
1504
|
content_id = int(test_file.content_id)
|
|
@@ -1510,7 +1509,7 @@ class TestFiles(FunctionalTest):
|
1510
|
1509
|
'admin@admin.admin'
|
1511
|
1510
|
)
|
1512
|
1511
|
)
|
1513
|
|
- res = self.testapp.put(
|
|
1512
|
+ self.testapp.put(
|
1514
|
1513
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1515
|
1514
|
upload_files=[
|
1516
|
1515
|
('files', test_file.file_name, test_file.depot_file.file.read())
|
|
@@ -1525,7 +1524,7 @@ class TestFiles(FunctionalTest):
|
1525
|
1524
|
)
|
1526
|
1525
|
assert res.content_type == 'application/pdf'
|
1527
|
1526
|
|
1528
|
|
- def test_api__get_pdf_preview__ok__err__400_page_of_preview_not_found(self) -> None:
|
|
1527
|
+ def test_api__get_pdf_preview__ok__err__400_page_of_preview_not_found(self) -> None: # nopep8
|
1529
|
1528
|
"""
|
1530
|
1529
|
get full pdf preview of a txt file
|
1531
|
1530
|
"""
|
|
@@ -1564,7 +1563,7 @@ class TestFiles(FunctionalTest):
|
1564
|
1563
|
'Test_file.txt',
|
1565
|
1564
|
'text/plain',
|
1566
|
1565
|
)
|
1567
|
|
- content_api.update_content(test_file, 'Test_file', '<p>description</p>')
|
|
1566
|
+ content_api.update_content(test_file, 'Test_file', '<p>description</p>') # nopep8
|
1568
|
1567
|
dbsession.flush()
|
1569
|
1568
|
transaction.commit()
|
1570
|
1569
|
content_id = int(test_file.content_id)
|
|
@@ -1575,7 +1574,7 @@ class TestFiles(FunctionalTest):
|
1575
|
1574
|
'admin@admin.admin'
|
1576
|
1575
|
)
|
1577
|
1576
|
)
|
1578
|
|
- res = self.testapp.put(
|
|
1577
|
+ self.testapp.put(
|
1579
|
1578
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1580
|
1579
|
upload_files=[
|
1581
|
1580
|
('files', test_file.file_name, test_file.depot_file.file.read())
|
|
@@ -1583,7 +1582,7 @@ class TestFiles(FunctionalTest):
|
1583
|
1582
|
status=204,
|
1584
|
1583
|
)
|
1585
|
1584
|
params = {'page': 1}
|
1586
|
|
- res = self.testapp.get(
|
|
1585
|
+ self.testapp.get(
|
1587
|
1586
|
'/api/v2/workspaces/1/files/{}/preview/pdf'.format(content_id),
|
1588
|
1587
|
status=400,
|
1589
|
1588
|
params=params,
|
|
@@ -1635,7 +1634,7 @@ class TestFiles(FunctionalTest):
|
1635
|
1634
|
'admin@admin.admin'
|
1636
|
1635
|
)
|
1637
|
1636
|
)
|
1638
|
|
- res = self.testapp.put(
|
|
1637
|
+ self.testapp.put(
|
1639
|
1638
|
'/api/v2/workspaces/1/files/{}/raw'.format(content_id),
|
1640
|
1639
|
upload_files=[
|
1641
|
1640
|
('files', image.name, image.getvalue())
|
|
@@ -1643,7 +1642,7 @@ class TestFiles(FunctionalTest):
|
1643
|
1642
|
status=204,
|
1644
|
1643
|
)
|
1645
|
1644
|
res = self.testapp.get(
|
1646
|
|
- '/api/v2/workspaces/1/files/{content_id}/revisions/{revision_id}/raw'.format(
|
|
1645
|
+ '/api/v2/workspaces/1/files/{content_id}/revisions/{revision_id}/raw'.format( # nopep8
|
1647
|
1646
|
content_id=content_id,
|
1648
|
1647
|
revision_id=revision_id,
|
1649
|
1648
|
),
|
|
@@ -1652,9 +1651,10 @@ class TestFiles(FunctionalTest):
|
1652
|
1651
|
assert res.content_type == 'text/plain'
|
1653
|
1652
|
params = {'page': 0}
|
1654
|
1653
|
res = self.testapp.get(
|
1655
|
|
- '/api/v2/workspaces/1/files/{content_id}/revisions/{revision_id}/preview/pdf'.format(
|
|
1654
|
+ '/api/v2/workspaces/1/files/{content_id}/revisions/{revision_id}/preview/pdf'.format( # nopep8
|
1656
|
1655
|
content_id=content_id,
|
1657
|
1656
|
revision_id=revision_id,
|
|
1657
|
+ params=params,
|
1658
|
1658
|
),
|
1659
|
1659
|
status=200
|
1660
|
1660
|
)
|
|
@@ -1680,7 +1680,7 @@ class TestThreads(FunctionalTest):
|
1680
|
1680
|
'admin@admin.admin'
|
1681
|
1681
|
)
|
1682
|
1682
|
)
|
1683
|
|
- res = self.testapp.get(
|
|
1683
|
+ self.testapp.get(
|
1684
|
1684
|
'/api/v2/workspaces/2/threads/6',
|
1685
|
1685
|
status=400
|
1686
|
1686
|
)
|
|
@@ -1737,7 +1737,7 @@ class TestThreads(FunctionalTest):
|
1737
|
1737
|
'admin@admin.admin'
|
1738
|
1738
|
)
|
1739
|
1739
|
)
|
1740
|
|
- res = self.testapp.get(
|
|
1740
|
+ self.testapp.get(
|
1741
|
1741
|
'/api/v2/workspaces/2/threads/170',
|
1742
|
1742
|
status=400
|
1743
|
1743
|
)
|
|
@@ -1753,7 +1753,7 @@ class TestThreads(FunctionalTest):
|
1753
|
1753
|
'admin@admin.admin'
|
1754
|
1754
|
)
|
1755
|
1755
|
)
|
1756
|
|
- res = self.testapp.get(
|
|
1756
|
+ self.testapp.get(
|
1757
|
1757
|
'/api/v2/workspaces/1/threads/7',
|
1758
|
1758
|
status=400
|
1759
|
1759
|
)
|
|
@@ -1769,7 +1769,7 @@ class TestThreads(FunctionalTest):
|
1769
|
1769
|
'admin@admin.admin'
|
1770
|
1770
|
)
|
1771
|
1771
|
)
|
1772
|
|
- res = self.testapp.get(
|
|
1772
|
+ self.testapp.get(
|
1773
|
1773
|
'/api/v2/workspaces/40/threads/7',
|
1774
|
1774
|
status=400
|
1775
|
1775
|
)
|
|
@@ -1785,7 +1785,7 @@ class TestThreads(FunctionalTest):
|
1785
|
1785
|
'admin@admin.admin'
|
1786
|
1786
|
)
|
1787
|
1787
|
)
|
1788
|
|
- res = self.testapp.get(
|
|
1788
|
+ self.testapp.get(
|
1789
|
1789
|
'/api/v2/workspaces/coucou/threads/7',
|
1790
|
1790
|
status=400
|
1791
|
1791
|
)
|
|
@@ -1801,7 +1801,7 @@ class TestThreads(FunctionalTest):
|
1801
|
1801
|
'admin@admin.admin'
|
1802
|
1802
|
)
|
1803
|
1803
|
)
|
1804
|
|
- res = self.testapp.get(
|
|
1804
|
+ self.testapp.get(
|
1805
|
1805
|
'/api/v2/workspaces/2/threads/coucou',
|
1806
|
1806
|
status=400
|
1807
|
1807
|
)
|
|
@@ -1891,7 +1891,7 @@ class TestThreads(FunctionalTest):
|
1891
|
1891
|
'label': '',
|
1892
|
1892
|
'raw_content': '<p> Le nouveau contenu </p>',
|
1893
|
1893
|
}
|
1894
|
|
- res = self.testapp.put_json(
|
|
1894
|
+ self.testapp.put_json(
|
1895
|
1895
|
'/api/v2/workspaces/2/threads/7',
|
1896
|
1896
|
params=params,
|
1897
|
1897
|
status=400
|
|
@@ -1983,7 +1983,7 @@ class TestThreads(FunctionalTest):
|
1983
|
1983
|
assert content['status'] == 'open'
|
1984
|
1984
|
|
1985
|
1985
|
# set status
|
1986
|
|
- res = self.testapp.put_json(
|
|
1986
|
+ self.testapp.put_json(
|
1987
|
1987
|
'/api/v2/workspaces/2/threads/7/status',
|
1988
|
1988
|
params=params,
|
1989
|
1989
|
status=204
|
|
@@ -2014,7 +2014,7 @@ class TestThreads(FunctionalTest):
|
2014
|
2014
|
'status': 'unexistant-status',
|
2015
|
2015
|
}
|
2016
|
2016
|
|
2017
|
|
- res = self.testapp.put_json(
|
|
2017
|
+ self.testapp.put_json(
|
2018
|
2018
|
'/api/v2/workspaces/2/threads/7/status',
|
2019
|
2019
|
params=params,
|
2020
|
2020
|
status=400
|