Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using real images #27

Open
Pomax opened this issue Aug 12, 2020 · 1 comment
Open

Using real images #27

Pomax opened this issue Aug 12, 2020 · 1 comment

Comments

@Pomax
Copy link

Pomax commented Aug 12, 2020

Is there a way to have the image factory use real images, rather than solid color fields? Wagtail has lots of different crop/focus/fill/etc rules for its {% image ... %} tag that can't be tested with solid colors, so being able to specify a real (set of) image(s), either static or from the actual CMS, would be incredibly valuable.

(maybe it's something that actually already works, only requiring a set of options to be passed into factory_boy?)

@easherma
Copy link

@Pomax factory_boy has 'from_file' as an available parameter:
https://factoryboy.readthedocs.io/en/latest/orms.html#factory.django.ImageField

There's an idea here for using a collection of demo images:
FactoryBoy/factory_boy#576

Something clever with 'from_path' and an online image library might also do the trick?

Some problems with either of those approaches, but hopefully that can give a sense of some possibilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants