test_location_cms

Posted 两掺豆腐脑丶

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了test_location_cms相关的知识,希望对你有一定的参考价值。

# -*- coding: utf-8 -*-

"""
@Time    : 2021/12/21 9:44
@Author  : 阿涛@
"""
import unittest
import requests


class TestlocationCMS(unittest.TestCase):

    def Headers_(self):  # 公有方法 请求头类型
        # self.session
        headers = 
            "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (Khtml, like Gecko) Chrome/96.0.4664.93 Safari/537.36"
        
        return headers

    def test_001_login(self):
        url = "http://192.168.179.130:8088/cmswu/manage/loginJump.do"
        data = 
            "userAccount": "admin",
            "loginPwd": "123456"
        
        res = requests.post(url, data,headers=self.Headers_())
        print(res.text)
        assert "登录成功!" in res.text

    def test_002_QueryUser(self):
        url = "http://192.168.179.130:8088/cmswu/manage/queryUserList.do"
        data 

以上是关于test_location_cms的主要内容,如果未能解决你的问题,请参考以下文章