def setUpClass(cls): global mysql mysql = MysqlUtil() sql = "select * from message.message_circle where id != '' order by id desc limit 1; " global max_uuid max_uuid = mysql.fetch_one(sql) # 事先从数据库中查出最新的圈子信息 print(max_uuid)
def setUp(self): global mysql mysql = MysqlUtil() global max_id sql = "select * from message.message_circle_vote_questions_link where id != '' order by id desc limit 1;" max_id = mysql.fetch_one(sql) # 事先查出最新的投票问答,评论
def setUpClass(cls): global mysql mysql = MysqlUtil() sql = "select * from message.message_circle where id != '' order by id desc limit 1; " global max_uuid max_uuid = mysql.fetch_one(sql)['id'] # 事先查出来圈子表中最新的id,也就是最新的那个圈子
def setUp(self): global mysql mysql = MysqlUtil() sql = "select * from message.message_circle_vote_questions where id != '' order by id desc limit 1;" global max_id max_id = mysql.fetch_one(sql)[ 'id'] # 事先取出数据库中,未新增问答前的最大id,因为后面接口新增成功,数据库中id会+1
def setUpClass(cls): global mysql mysql = MysqlUtil() sql_1 = "select * from message.message_circle_link_account where circle_uuid = '555c54bb67a546569969e8c5d8d0c538' and join_type = 0 and `status` = 1;" #第四个圈子关联账号 sql_2 = "select * from message.message_circle_link_account where circle_uuid = 'd41b03780174469ba858a3db5ae0f05d' and join_type = 0 and `status` = 1;" #第三个圈子关联账号 global four_max, three_max # 声明全局变量 four_max = mysql.fetch_all(sql_1) # 查询出第四个圈子,下属短账号,返回的是list three_max = mysql.fetch_all(sql_2)
def setUp(self): global mysql mysql = MysqlUtil() global domain domain = mysql.fetch_one( "SELECT * FROM message.`message_circle_field` where id != '' order by id desc limit 1;" )
def setUp(self): global mysql mysql = MysqlUtil() global max_circle # 事先从数据库中查出,可以加入领域的 圈子 max_circle = mysql.fetch_all( "select m.title,m.uuid from message.message_circle m where m.`status`=1 and m.uuid not in (select circle_uuid from message.message_circle_field_link where `status`=2)" )
def setUp(self): global mysql mysql = MysqlUtil() global article_status sql = "select * from message.message_circle_link where circle_uuid = '555c54bb67a546569969e8c5d8d0c538' and message_uuid = '9db154e2be2e450488bb8dd14c767f4b';" article_status = mysql.fetch_one( sql )['status'] # 事先查出:第一条用例时"9db154e2be2e450488bb8dd14c767f4b"在第四个圈子中的状态,应该是为0
def setUp(self): global mysql mysql = MysqlUtil() global max_counts max_counts = mysql.fetch_all( "select * from message.message_circle_field where id != '' order by id desc " ) # 事先查出所有的领域
def setUp(self): global mysql mysql = MysqlUtil() sql_1 = "select * from message.message_circle_link_account " \ "where circle_uuid = '555c54bb67a546569969e8c5d8d0c538' " \ "and account_uuid = 'eab0303b2db04247add02ad2f0d13682'" global join_status join_status = mysql.fetch_one(sql_1)[ 'status'] # 提前查出:第一条用例时"开心就好"在第四个圈子中的状态,应该是为0
def setUp(self): global mysql mysql = MysqlUtil() sql = "select * from message.message_circle_link_account" \ " where circle_uuid = '555c54bb67a546569969e8c5d8d0c538' " \ "and account_uuid = '7cd855be8df149bc86d816add22ec3d3' ;" global super_status super_status = mysql.fetch_one(sql)[ 'status'] # 事先查出super 用户,在第四个圈子的 状态
def setUp(self): global mysql mysql = MysqlUtil() global newest_vote vote_sql = "select * from message.message_circle_vote_questions" \ " where circle_uuid = '555c54bb67a546569969e8c5d8d0c538' " \ "and activity_type = 1 " \ "and status = 1 " \ "order by id desc limit 1;" newest_vote = mysql.fetch_one(vote_sql) #提前查询出 第四个圈子下,最新的启用状态投票 global newest_answers ans_sql = "select * from message.message_circle_vote_questions " \ "where circle_uuid = '555c54bb67a546569969e8c5d8d0c538' " \ "and activity_type = 2 " \ "and status = 1 " \ "order by id desc limit 1;" newest_answers = mysql.fetch_one(ans_sql) #提前查询出 第四个圈子下,最新的启用状态问答
def setUp(self): global mysql mysql = MysqlUtil() # 数据库实例化 global max_circle_field_link # 把圈子领域信息表中最大值查出来 max_circle_field_link = mysql.fetch_one( "select * from message.message_circle_field_link where id != '' order by id desc;" )['id'] global enabled_circle, enabled_domain # 四个全局变量,参数中要用到:启用的圈子/禁用的圈子 启用的领域/禁用的领域 # 事先从数据库查出需要的参数 enabled_circle = mysql.fetch_one( "select * from message.message_circle" " where `status` = 1 and uuid " "not in(select circle_uuid from message.message_circle_field_link where `status` = 2 ) " "order by id desc limit 1;") # 查出可以加入领域的圈子 enabled_domain = mysql.fetch_one( "select * from message.message_circle_field where id != '' and status = 2 order by id desc limit 1 ;" ) # 启用状态领域
def setUp(self): global mysql mysql = MysqlUtil() global alter_ago sql = "select * from message.message_circle_vote_questions where circle_uuid = '555c54bb67a546569969e8c5d8d0c538' and activity_type = 1 order by id desc limit 1;" alter_ago = mysql.fetch_one(sql) # 事先查出第四个圈子下最新的一个投票
def setUp(self): global mysql mysql = MysqlUtil() global max_id sql = "select * from message.message_circle_link where circle_uuid = '555c54bb67a546569969e8c5d8d0c538' order by id desc limit 1;" max_id = mysql.fetch_one(sql)['id'] # 事先查出"第四个圈子"下最新的发布id,因为后面调用发布接口,成功后数据库id会加1
def setUp(self): global mysql mysql = MysqlUtil() sql = "select * from message.message_circle_vote_questions where id != '' order by id desc limit 1; " global max_id max_id = mysql.fetch_one(sql)['id'] # 事先查出最新的圈子投票id
def setUp(self): global mysql mysql = MysqlUtil() global newest_id sql = "select * from message.message_circle_vote_questions where circle_uuid = '555c54bb67a546569969e8c5d8d0c538' order by id desc limit 1;" newest_id = mysql.fetch_one(sql) # 第四个圈子下,最新的问答信息
def setUp(self): print("============================开始测试============================") global mysql mysql = MysqlUtil() global newest newest = mysql.fetch_one("SELECT * FROM message.`message_circle_field` where id != '' order by id desc limit 1;")# 事先查出最新的领域
def setUpClass(cls): global mysql mysql = MysqlUtil() sql = "select * from message.message_circle_link where circle_uuid = 'd41b03780174469ba858a3db5ae0f05d' and type = 1 and `status` != 0;" global spam_type spam_type = mysql.fetch_all(sql) #事先从数据库查出,第三个圈子,下属所有刷屏
def setUp(self): global mysql mysql = MysqlUtil() sql = "select * from message.message_circle_vote_questions where circle_uuid = '555c54bb67a546569969e8c5d8d0c538';" global vote_max vote_max = mysql.fetch_all(sql) # 事先从数据库中查出来,第四个圈子下的投票(存在一个圈子下,多个投票的情况,所以返回list)