@pytest.fixture(scope='function')
def coupons(db):
    db.session.query(Coupon).delete()

    may_29_2015 = datetime.datetime(2015, 05, 29, 0, 0, 0)
    may_29_2015 = pytz.utc.localize(may_29_2015)

    june_29_2015 = datetime.datetime(2015, 06, 29)
    june_29_2015 = pytz.utc.localize(june_29_2015)

    coupons = [
        {
            'amount_off': 1,
            'redeem_by': may_29_2015
        },
        {
            'amount_off': 1,
            'redeem_by': june_29_2015
        },
        {
            'amount_off': 1
        }
    ]

    for coupon in coupons:
        db.session.add(Coupon(**coupon))

    db.session.commit()

    return db
Create coupon fixtures. They reset per test.
dataset/ETHPy150Open nickjj/build-a-saas-app-with-flask/catwatch/tests/conftest.py/coupons