【问题标题】:Need bring actual date in .yalm file需要在 .yaml 文件中带来实际日期
【发布时间】: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 }

【问题讨论】:

    标签: testing tavern


    【解决方案1】:

    可能的解决方案是在顶部写下以下行

    strict: False
    

    这将允许您评估哪个属性或不评估哪个属性

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-24
      • 1970-01-01
      • 2018-06-25
      • 2017-11-02
      • 1970-01-01
      • 2010-11-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多