コード例 #1
0
ファイル: test_project_team.py プロジェクト: wengdarui/Grubby
import time
import datetime
import json
import re
from Common import encryption
from Common import Reids
from Common import DB
from Common import Read_config
from Common.BaseCase import BaseCase

#数据准备
cf = Read_config.ReadConfig()
db = DB.DB_enterprise()
re = Reids.Redis()
logintoken = cf.get_userdatainfo('logintoken')
worksurfaceid = cf.get_project('worksurfaceid')
addemployeeid2 = cf.get_employeeinfo('addemployeeid2')
addemployeeid = cf.get_employeeinfo('addemployeeid')
daytime = time.strftime('%Y-%m-%d', time.localtime(time.time()))
utctime = datetime.datetime.utcnow().isoformat()


class test_project_team(BaseCase):
    def test_add_teamemployee(self):  #添加项目人员
        cf = Read_config.ReadConfig()
        projectid = cf.get_project('projectid')
        data_value = addemployeeid2 + ',' + projectid
        data = self.get_case_data("test_add_teamemployee")
        check = self.send_request(data,
                                  headersvariable=logintoken,
                                  datavariable=data_value)
コード例 #2
0
from Common import Read_config
from Common import DB

cf = Read_config.ReadConfig()
db_en = DB.DB_enterprise()
db_user = DB.DB_user()
"""
获取变量
"""
notphone = cf.get_userdatainfo('not_exist_phone')
projectid = cf.get_project("projectid")
corporation_master_id = cf.get_userdatainfo("corporation_master_id")
enterpriseid = cf.get_enterpriseinfo("enterpriseid")
buildenterpriseid = cf.get_enterpriseinfo("buildenterpriseid")
checkenterpriseid = cf.get_enterpriseinfo("checkenterpriseid")
"""
被执行的sql(管理员用户)
"""
del_Adminuser_sql = """ DELETE FROM tb_user WHERE phone = %s """
"""
被执行的sql(企业部门)
"""
del_company_sql = """ DELETE FROM `company` WHERE corporation_master_id = %s  """
#包含默认创建及测试添加
del_employee_sql = """ DELETE FROM `employee` WHERE company_id = %s """
del_department_sql = """ DELETE FROM `department` WHERE company_id = %s """
"""
被执行的sql(工程项目)
"""
del_project_sql = """ DELETE FROM project WHERE id = %s """
del_project_company_sql = """ DELETE FROM project_company WHERE project_id = %s """