From d5e02d331928d3be7980dee5e3aa0c5e1acab0fb Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 23 Jun 2017 14:43:04 +0800 Subject: [PATCH] use utils.gen_md5 function to generate md5 value --- test/api_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/api_server.py b/test/api_server.py index 05f224f1..1bf8368f 100644 --- a/test/api_server.py +++ b/test/api_server.py @@ -3,6 +3,7 @@ import json from functools import wraps from flask import Flask, make_response, request +from ate import utils app = Flask(__name__) @@ -36,8 +37,7 @@ def validate_request(func): req_authorization = req_headers['Authorization'] random_str = req_headers['Random'] data = request.data.decode("utf-8") - authorization_str = "".join([TOKEN, data, random_str]) - authorization = hashlib.md5(authorization_str.encode('utf-8')).hexdigest() + authorization = utils.gen_md5([TOKEN, data, random_str]) assert authorization == req_authorization return func(*args, **kwds) except (KeyError, AssertionError):