CICD/app/fizz/fizzbaz/model_test.py
2019-05-18 13:00:13 -04:00

23 lines
528 B
Python

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:
return Fizzbaz(
fizzbaz_id=1, name='Test fizzbaz', purpose='Test purpose'
)
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__