feat: add test photos (CC0)
This commit is contained in:
parent
19e379fbc9
commit
52dfc2902a
@ -1,5 +1,5 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.files import File
|
||||
|
||||
from fellchensammlung.models import *
|
||||
from fellchensammlung import baker_recipes
|
||||
@ -29,6 +29,17 @@ class Command(BaseCommand):
|
||||
rat2 = baker.make(Animal, name="Rat2", adoption_notice=adoption1, species=rat)
|
||||
cat1 = baker.make(Animal, name="Cat1", adoption_notice=adoption2, species=cat)
|
||||
|
||||
animal_photo_combination = [(cat1, "cat1.jpeg"), (rat1, "rat1.jpg"), (rat2, "rat2.jpg")]
|
||||
for animal, filename in animal_photo_combination:
|
||||
image_object = Image()
|
||||
image_object.alt_text = f"Picture of {animal}"
|
||||
image_object.title = f"Picture of {animal}"
|
||||
image_object.image.save(f"{filename}", File(open(f"./src/fellchensammlung/tests/assets/{filename}", 'rb')))
|
||||
image_object.save()
|
||||
|
||||
animal.photos.add(image_object)
|
||||
|
||||
|
||||
rule1 = baker.make(Rule, title="Be excellent ot each other", rule_text="This is **markdown**")
|
||||
rule2 = baker.make(Rule,
|
||||
title="Keep al least the minimum number of animals for species",
|
||||
|
BIN
src/fellchensammlung/tests/assets/cat1.jpeg
Normal file
BIN
src/fellchensammlung/tests/assets/cat1.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 350 KiB |
BIN
src/fellchensammlung/tests/assets/cat2.jpeg
Normal file
BIN
src/fellchensammlung/tests/assets/cat2.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 385 KiB |
BIN
src/fellchensammlung/tests/assets/rat1.jpg
Normal file
BIN
src/fellchensammlung/tests/assets/rat1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 MiB |
BIN
src/fellchensammlung/tests/assets/rat2.jpg
Normal file
BIN
src/fellchensammlung/tests/assets/rat2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
BIN
src/fellchensammlung/tests/assets/rat3.jpg
Normal file
BIN
src/fellchensammlung/tests/assets/rat3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 MiB |
BIN
src/fellchensammlung/tests/assets/rat_cuddle_puddle_1.jpg
Normal file
BIN
src/fellchensammlung/tests/assets/rat_cuddle_puddle_1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 MiB |
Loading…
Reference in New Issue
Block a user