pycontw / pycon.tw

PyCon TW Proposal System & Backend Server
https://tw.pycon.org/prs
MIT License
95 stars 107 forks source link

feat:attendee-app-unit-test #1142

Closed Ritabear closed 6 months ago

Ritabear commented 1 year ago

https://discord.com/channels/752904426057892052/1041070387909378190

#### 目標 API 
<django>/api/attendee/verify/
#### 需求
- <nuxt>/ext/live?token=<token> 會順便用 token POST 目標 API
- <nuxt>/ext/discord?token=<token> 會順便用 token POST 目標 API
#### 分析
- 目標 API 的 Input 需有 CONFERENCE_DEFAULT_SLUG, reg, Attendee 的 token
    - CONFERENCE_DEFAULT_SLUG
        - 格式為 e.g. "pycontw-2023"
    - reg = 單或多個 registry's Entry
        - // Entry 的 CRUD 在 <django>/admin/registry/entry/
        - Entry 需有 key, value
        - Entry 格式為 e.g. key = "pycontw-2023.live.r0", value = video_id
    - Attendee 的 token
        - // Attendee 的 CRUD 在 <django>/admin/attendee/attendee
        - Attendee 需有 token
- 目標 API 的 Output 需有 room 和 video_id
    - room = room_name
        - 格式為 e.g. "r0"
        - 需用 CONFERENCE_DEFAULT_SLUG 搭配 reg 的 key 產出
    - video_id = Entry's value
        - 格式需使 https://www.youtube.com/embed/<video_id> 合法

對於Unit Testing,目前初步計畫上述裡,有"格式","需有","需用"的句子都各別至少1個Test Case。

Ref:

  1. https://github.com/pycontw/pycon.tw/tree/master/src/attendee
  2. https://github.com/pycontw/pycon.tw/blob/master/src/pycontw2016/settings/base.py
  3. https://github.com/yychen/dj-registry
  4. https://github.com/pycontw/pycontw-frontend/blob/3e1de18b38b6767494778cd9c9e0722158ff3005/store/index.js
josix commented 6 months ago

Resolved by #1146