CICD/app/fizz/fizzbar/model_test.py

21 lines
514 B
Python
Raw Normal View History

2019-05-18 19:00:13 +02:00
from pytest import fixture
from flask_sqlalchemy import SQLAlchemy
from app.test.fixtures import app, db # noqa
from .model import Fizzbar
@fixture
def fizzbar() -> Fizzbar:
2019-08-03 18:55:38 +02:00
return Fizzbar(fizzbar_id=1, name="Test fizzbar", purpose="Test purpose")
2019-05-18 19:00:13 +02:00
def test_Fizzbar_create(fizzbar: Fizzbar):
assert fizzbar
def test_Fizzbar_retrieve(fizzbar: Fizzbar, db: SQLAlchemy): # noqa
db.session.add(fizzbar)
db.session.commit()
s = Fizzbar.query.first()
assert s.__dict__ == fizzbar.__dict__