test_invite_colleague.py
2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import json
from atdd.ATDDCase import ATDDCase
from tests.Integral.publicMethods import PCpublicMethods
class InviteColleague(ATDDCase):
global list
url = ATDDCase().uc_host + '/a/' + ATDDCase().domain + '/' + ATDDCase().app + "/qy/integral/change"
businessKey = "invite_colleague"
triggerKeyDict = PCpublicMethods.PCpublicMethods().getTriggerKey(businessKey)
triggerValueDict = PCpublicMethods.PCpublicMethods().getTriggerValue(businessKey)
def setUp(self):
pass
# 邀请同事-邀请人数
def test_invite_number(self):
print(self.triggerKeyDict)
data = {
"memUid": self.jipeihong_uid,
"businessKey": self.businessKey,
"businessAct": "invite_number",
"remark": "邀请同事-邀请人数",
"businessId": "55",
"triggerTypes": [
{
"triggerKey": "number", #人数(循环类型) 全局
"value": 2
}
]
}
result = self.post(self.url, json.dumps(data), headers=self.header_json)
code = result.json()['code']
print(result.json())
self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用
self.assertEquals(code,'SUCCESS')
# 邀请同事-审核通过
def test_review_pass(self):
print(self.triggerKeyDict)
data = {
"memUid": self.jipeihong_uid,
"businessKey": self.businessKey,
"businessAct": "review_pass",
"remark": "邀请同事-审核通过",
"businessId": "55",
"triggerTypes": [
{
"triggerKey": "number", #人数(循环类型) 全局
"value": 2
}
]
}
result = self.post(self.url, json.dumps(data), headers=self.header_json)
code = result.json()['code']
print(result.json())
self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用
self.assertEquals(code,'SUCCESS')
# 邀请同事-审核驳回
def test_review_reject(self):
print(self.triggerKeyDict)
data = {
"memUid": self.jipeihong_uid,
"businessKey": self.businessKey,
"businessAct": "review_reject",
"remark": "邀请同事-审核驳回",
"businessId": "55",
"triggerTypes": [
{
"triggerKey": "number", #人数(循环类型) 全局
"value": 2
}
]
}
result = self.post(self.url, json.dumps(data), headers=self.header_json)
code = result.json()['code']
print(result.json())
self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用
self.assertEquals(code, 'SUCCESS')