mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Wagtailimages: Test image is now created on the fly
This commit is contained in:
parent
451f133d3b
commit
f565f4b79b
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB |
@ -8,7 +8,14 @@ from wagtail.wagtailimages.templatetags import image_tags
|
||||
|
||||
|
||||
def get_test_image_file():
|
||||
return 'wagtail/wagtailimages/static/wagtailimages/images/test.png'
|
||||
from StringIO import StringIO
|
||||
from PIL import Image
|
||||
from django.core.files.images import ImageFile
|
||||
|
||||
f = StringIO()
|
||||
image = Image.new('RGB', (640, 480), 'white')
|
||||
image.save(f, 'PNG')
|
||||
return ImageFile(f, name='test.png')
|
||||
|
||||
|
||||
Image = get_image_model()
|
||||
|
Loading…
Reference in New Issue
Block a user