Skip to content
Snippets Groups Projects
Commit fbf83bc4 authored by Arno Wunderlich's avatar Arno Wunderlich
Browse files

adding image to test case

parent 5a9a3330
No related branches found
No related tags found
1 merge request!27Add image to list bid
Pipeline #14818 passed
......@@ -73,7 +73,7 @@ class Item(db.Document):
created_at = DateTimeField(required=True, default=datetime.utcnow)
closes_at = DateTimeField(required=True)
closes_at = DateTimeField()
image = FileField()
......
src/tjts5901/test.jpeg

14.2 KiB

......@@ -42,12 +42,17 @@ def test_item_adding():
user.password = "placeholder"
user.save()
#load test image
with open("src/tjts5901/test.jpeg", "rb") as image_file:
image = image_file.read()
# Create a new item
item = Item()
item.title = "Test title"
item.description = "This is a test description"
item.starting_bid = 100
item.seller = user
item.image = image
item.save()
return "OK"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment