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

db test completed

parent 22bbcfd2
No related branches found
No related tags found
1 merge request!5Db init
Pipeline #13702 passed
......@@ -31,8 +31,14 @@ def test_item_adding():
from .models import Item, User
# for test purpose create random number (unique mail address required)
import random
ran_int = str(random.randint(0,10000))
# Create a new user
user = User()
user.email = "test" + ran_int + "@gmail.com"
user.password = "placeholder"
user.save()
# Create a new item
......@@ -40,6 +46,7 @@ def test_item_adding():
item.title = "Test title"
item.description = "This is a test description"
item.starting_bid = 100
item.seller = user
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