test_add_org.py 899 Bytes
# Author: jipeihong 2017年11月7日14:52:52

from atdd.PcPost import PcPost
from tests.Staff_Management.Organization.public_org import PulbicOrg
import random

class AddOrg(PcPost):

    interfaceUrl = "/contact/Apicp/Department/Save"

    def setUp(self):
        self.do_login(self.host, self.mobile, self.psw, self.domain)

    def test_add_org(self):
        x = random.randint(0,1000)
        top_dpId = PulbicOrg().get_top_org()
        data = {
            "department_id": None,
            "parent_id": top_dpId, # 顶级部门
            "dp_name": "总部组织"+ str(x),
            "is_all": 1,
            "is_dept": 0,
            "dpt_id": "755DD9820A69039F18591A29AC42531A", # 组织类型
            "dp_serial_num": 1,
            "dp_leader_uids[0]": self.jipeihong_uid
        }
        result = self.PcPost(self.interfaceUrl,data)
        print(result)
        return result