CICD/app/fizz/fizzbaz/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 Fizzbaz
@fixture
def fizzbaz() -> Fizzbaz:
2019-08-03 18:55:38 +02:00
return Fizzbaz(fizzbaz_id=1, name="Test fizzbaz", purpose="Test purpose")
2019-05-18 19:00:13 +02:00
def test_Fizzbaz_create(fizzbaz: Fizzbaz):
assert fizzbaz
def test_Fizzbaz_retrieve(fizzbaz: Fizzbaz, db: SQLAlchemy): # noqa
db.session.add(fizzbaz)
db.session.commit()
s = Fizzbaz.query.first()
assert s.__dict__ == fizzbaz.__dict__