Browse Source

rename test image method

Guénaël Muller 6 years ago
parent
commit
5218d251e5
2 changed files with 10 additions and 9 deletions
  1. 1 1
      tracim/tests/__init__.py
  2. 9 8
      tracim/tests/functional/test_contents.py

+ 1 - 1
tracim/tests/__init__.py View File

@@ -55,7 +55,7 @@ def set_html_document_slug_to_legacy(session_factory) -> None:
55 55
     assert content_query.count() > 0
56 56
 
57 57
 
58
-def create_test_image():
58
+def create_1000px_png_test_image():
59 59
     file = BytesIO()
60 60
     image = Image.new('RGBA', size=(1000, 1000), color=(0, 0, 0))
61 61
     image.save(file, 'png')

+ 9 - 8
tracim/tests/functional/test_contents.py View File

@@ -12,7 +12,8 @@ from tracim.lib.core.workspace import WorkspaceApi
12 12
 from tracim.models.data import ContentType
13 13
 from tracim.models import get_tm_session
14 14
 from tracim.models.revision_protection import new_revision
15
-from tracim.tests import FunctionalTest, create_test_image
15
+from tracim.tests import FunctionalTest
16
+from tracim.tests import create_1000px_png_test_image
16 17
 from tracim.tests import set_html_document_slug_to_legacy
17 18
 from tracim.fixtures.content import Content as ContentFixtures
18 19
 from tracim.fixtures.users_and_groups import Base as BaseFixture
@@ -1032,7 +1033,7 @@ class TestFiles(FunctionalTest):
1032 1033
         dbsession.flush()
1033 1034
         transaction.commit()
1034 1035
         content_id = int(test_file.content_id)
1035
-        image = create_test_image()
1036
+        image = create_1000px_png_test_image()
1036 1037
         self.testapp.authorization = (
1037 1038
             'Basic',
1038 1039
             (
@@ -1144,7 +1145,7 @@ class TestFiles(FunctionalTest):
1144 1145
         dbsession.flush()
1145 1146
         transaction.commit()
1146 1147
         content_id = int(test_file.content_id)
1147
-        image = create_test_image()
1148
+        image = create_1000px_png_test_image()
1148 1149
         self.testapp.authorization = (
1149 1150
             'Basic',
1150 1151
             (
@@ -1197,7 +1198,7 @@ class TestFiles(FunctionalTest):
1197 1198
         dbsession.flush()
1198 1199
         transaction.commit()
1199 1200
         content_id = int(test_file.content_id)
1200
-        image = create_test_image()
1201
+        image = create_1000px_png_test_image()
1201 1202
         self.testapp.authorization = (
1202 1203
             'Basic',
1203 1204
             (
@@ -1252,7 +1253,7 @@ class TestFiles(FunctionalTest):
1252 1253
         dbsession.flush()
1253 1254
         transaction.commit()
1254 1255
         content_id = int(test_file.content_id)
1255
-        image = create_test_image()
1256
+        image = create_1000px_png_test_image()
1256 1257
         self.testapp.authorization = (
1257 1258
             'Basic',
1258 1259
             (
@@ -1310,7 +1311,7 @@ class TestFiles(FunctionalTest):
1310 1311
         transaction.commit()
1311 1312
         content_id = int(test_file.content_id)
1312 1313
         revision_id = int(test_file.revision_id)
1313
-        image = create_test_image()
1314
+        image = create_1000px_png_test_image()
1314 1315
         self.testapp.authorization = (
1315 1316
             'Basic',
1316 1317
             (
@@ -1439,7 +1440,7 @@ class TestFiles(FunctionalTest):
1439 1440
         dbsession.flush()
1440 1441
         transaction.commit()
1441 1442
         content_id = int(test_file.content_id)
1442
-        image = create_test_image()
1443
+        image = create_1000px_png_test_image()
1443 1444
         self.testapp.authorization = (
1444 1445
             'Basic',
1445 1446
             (
@@ -1626,7 +1627,7 @@ class TestFiles(FunctionalTest):
1626 1627
         transaction.commit()
1627 1628
         content_id = int(test_file.content_id)
1628 1629
         revision_id = int(test_file.revision_id)
1629
-        image = create_test_image()
1630
+        image = create_1000px_png_test_image()
1630 1631
         self.testapp.authorization = (
1631 1632
             'Basic',
1632 1633
             (