def setUp(self): mysql_session.flush() mysql_session.close() r_server.flushdb() Activity.__table__.drop(mysql_engine, checkfirst=True) Activity.__table__.create(mysql_engine, checkfirst=True) Board.__table__.drop(mysql_engine, checkfirst=True) Board.__table__.create(mysql_engine, checkfirst=True)
# -*- coding: utf-8 -*- from __future__ import absolute_import from models.user import User from models.board import Board from models.list import List from models.card import Card from models.comment import Comment from utils.db import mysql_engine, r_server r_server.flushdb() Board.__table__.drop(mysql_engine, checkfirst=True) Board.__table__.create(mysql_engine, checkfirst=True) User.__table__.drop(mysql_engine, checkfirst=True) User.__table__.create(mysql_engine, checkfirst=True) List.__table__.drop(mysql_engine, checkfirst=True) List.__table__.create(mysql_engine, checkfirst=True) Card.__table__.drop(mysql_engine, checkfirst=True) Card.__table__.create(mysql_engine, checkfirst=True) Comment.__table__.drop(mysql_engine, checkfirst=True) Comment.__table__.create(mysql_engine, checkfirst=True) uid0 = User.add("test1", "password", "*****@*****.**") uid1 = User.add("test2", "password", "*****@*****.**") uid2 = User.add("test3", "password", "*****@*****.**") user0 = User.get(uid0) user1 = User.get(uid1) user2 = User.get(uid2) bid0 = Board.add("board1", "A") bid1 = Board.add("board2", "A")