test_research_center.py 1.26 KB
import json

from atdd.ATDDCase import ATDDCase
from tests.Integral.publicMethods import PCpublicMethods


class ResearchCenter(ATDDCase):

    global list
    url = ATDDCase().uc_host + '/a/' + ATDDCase().domain + '/' + ATDDCase().app + "/qy/integral/change"
    businessKey = "research_center"
    triggerKeyDict = PCpublicMethods.PCpublicMethods().getTriggerKey(businessKey)
    triggerValueDict = PCpublicMethods.PCpublicMethods().getTriggerValue(businessKey)

    def setUp(self):
        pass

    # 调研中心-参与调研
    def test_join(self):
        print(self.triggerKeyDict)
        data = {
            "memUid": self.jipeihong_uid,
            "businessKey": self.businessKey,
            "businessAct": "join",
            "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')