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

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

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