Browse Source

pep8 + remove unused variables

Guénaël Muller 6 years ago
parent
commit
18894beecb
1 changed files with 62 additions and 62 deletions
  1. 62 62
      tracim/tests/functional/test_contents.py

+ 62 - 62
tracim/tests/functional/test_contents.py View File

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