def reg_admin():
        do_mysql = OperateMysql()

        reg_url = 'http://tj.lemonban.com/futureloan/mvc/api/member/register'
        phone = do_mysql.unreg_phone()
        param = {"mobilephone": phone, "pwd": "123456", "regname": "admin_nesta"}
        reg_request = HttpRequest()

        while True:
            reg_request.http_request(reg_url, 'post', param)

            sql = 'SELECT id FROM member where MobilePhone = %s'
            res = do_mysql.run_sql(sql, (phone,))
            if res:
                admin_data = {
                    'admin_user': {'mobilephone': phone,
                                   'memberid': res[0]['id'],
                                   'pwd': 123456
                                   }
                }

                # self.conf.write_config(data, os.path.join(CONFIG_PATH, 'user.conf'))
                do_mysql.mysql_close()
                break
        return admin_data
Exemple #2
0
 def setUpClass(cls):
     cls.request = HttpRequest()
     cls.session_request = cls.request.request_session
Exemple #3
0
 def setUpClass(cls):
     cls.request = HttpRequest()
     cls.session_request = cls.request.request_session
     cls.check_sql = OperateMysql()