working db and tests Nr2

This commit is contained in:
2019-03-14 17:14:05 +01:00
parent 1c8cb55b46
commit bd9b6c61d3
16 changed files with 624 additions and 0 deletions

13
database/db_populate.py Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python
from backend import db
from backend.models import example_model, user_model, post_model
user = user_model.User(nickname="tobi", email="privat@t-kurze.de")
user.set_password("abcxyz")
db.session.add(user)
example_data = example_model.ExampleDataItem(name="tolles data item", mac="12:34:56:78:90:AB")
db.session.add(example_data)
db.session.commit()