def teardownDatabase(): DBSession.rollback() metadata.drop_all(engine)
def setup_database(): init_model(engine) teardownDatabase() elixir.setup_all(True) # Creating users user = User() user.user_name = u'rms' user.password = u'freedom' DBSession.save(user) user = User() user.user_name = u'linus' user.password = u'linux' DBSession.save(user) user = User() user.user_name = u'sballmer' user.password = u'developers' DBSession.save(user) # Plus a couple of users without groups user = User() user.user_name = u'guido' user.password = u'phytonic' DBSession.save(user) user = User() user.user_name = u'rasmus' user.password = u'php' DBSession.save(user) DBSession.commit()
def setup_database(): init_model(engine) teardownDatabase() elixir.setup_all(True) # Creating users user = User() user.user_name = u'rms' user.password = u'freedom' DBSession.add(user) user = User() user.user_name = u'linus' user.password = u'linux' DBSession.add(user) user = User() user.user_name = u'sballmer' user.password = u'developers' DBSession.add(user) # Plus a couple of users without groups user = User() user.user_name = u'guido' user.password = u'phytonic' DBSession.add(user) user = User() user.user_name = u'rasmus' user.password = u'php' DBSession.add(user) DBSession.commit()