def testValid(self): val = validFields() db.session.add(val) db.session.commit() valid = validFields.query.filter_by(id=True).first() assert valid['simple'] == ['email', 'password'] assert valid['facebook'] == ['facebook_token']
# -*- coding: UTF-8 -*- from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) from app import views, models, controller try: db.session.add(models.validFields()) db.session.commit() except: pass