def make_env(env, data, nxt): metadata.create_all(env.db.bind) user = User(login='******', password=encrypt_password('123')) env.db.add(user) env.db.commit() try: return nxt(env, data) finally: env.db.close()
def set_password(self, password): self.password = encrypt_password(password)