【发布时间】:2019-09-23 14:22:47
【问题描述】:
我正在使用“tavern”来测试 Django API 休息。我在这个库中很新,我不知道我的问题是否可行,但需要第二个标题中的日期属性,带上当前日期而不是硬编码。
有可能吗?
stages:
- name: login
request:
url: http//......
json:
email: email
password: pass
method: POST
headers:
content-type: application/json
response:
status_code: 200
body:
{
"refresh": refresh token
"access": access token
"id": 1,
"username": username,
"email": email,
"first_name": name,
"last_name": last,
"group": group,
"manager": null,
"profile_photo": photo
}
headers:
content-type: application/json
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
x-frame-options: SAMEORIGIN
connection: close
server: Werkzeug/0.12.2 Python/3.6.2
date: { here is the field }
【问题讨论】: