I need to create a stored procedure in memory for my unit test. I'm using python/sqlalchemy/sqlite for the unit tests. I get an error:
AttributeError: 'SQLAlchemy' object has no attribute 'executeSql'
Is there a better way to create the stored procedure using session?
db = SQLAlchemy()
class TestEscalation(unittest.TestCase):
def setUp(self):
app.config.from_object('config.Testing')
self.app = app.test_client()
with app.app_context():
db.session.close()
db.drop_all()
db.create_all()
db.session.add(lobalarmescalationtime(id=1, clientid ='AS0001',priorityid = 1,escalationtime = 120))
db.executeSql('./dbscripts/storedproc.sql')
db.session.commit()
app.app_context().push()