Bin
2025-12-16 971a2a12c03b74dd2d7d668b9dbc599f5131bcaf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
test_name: crud for webhooks
marks:
  - usefixtures:
      - django_live_url
      - configured_project
stages:
  - id: signup
    type: ref
  - name: Get webhook info
    request:
      url: "{django_live_url}/api/webhooks/info/"
      method: GET
    response:
      status_code: 200
  - name: Create organization webhook
    request:
      url: "{django_live_url}/api/webhooks/"
      method: POST
      json:
        url: "http://127.0.0.1:6666/webhook"
        project: "{configured_project.id}"
        headers:
          Autorization: "Token 66666666666666666666666"
          Security: "123123123123123"
    response:
      status_code: 201
      save:
        json:
          webhook_id: id
  - name: Get organization webhook
    request:
      url: "{django_live_url}/api/webhooks/{webhook_id}/"
      method: GET
    response:
      status_code: 200
      json:
        id: !int "{webhook_id}"
        project: !int "{configured_project.id}"
        actions: !anylist
        created_at: !anystr
        updated_at: !anystr
        headers: !anydict
        send_payload: true
        send_for_all_actions: true
        organization: !anyint
        is_active: true
        url: "http://127.0.0.1:6666/webhook"
  - name: Get webhook list
    request:
      url: "{django_live_url}/api/webhooks/"
      method: GET
    response:
      status_code: 200
  - name: Update organization webhook
    request:
      url: "{django_live_url}/api/webhooks/{webhook_id}/"
      method: PATCH
      json:
        actions:
          - ANNOTATION_CREATED
          - ANNOTATION_UPDATED
          - ANNOTATIONS_DELETED
        send_for_all_actions: false
        send_payload: false
    response:
      status_code: 200
  - name: Second update organization webhook
    request:
      url: "{django_live_url}/api/webhooks/{webhook_id}/"
      method: PATCH
      json:
        actions:
          - TASKS_CREATED
          - ANNOTATION_UPDATED
        headers:
          Autorization: "token 123456789"
    response:
      status_code: 200
  - name: Delete organization webhook
    request:
      url: "{django_live_url}/api/webhooks/{webhook_id}/"
      method: DELETE
    response:
      status_code: 204
  - name: Create project webhook
    request:
      url: "{django_live_url}/api/webhooks/"
      method: POST
      json:
        url: "http://127.0.0.1:6666/webhook/proj/"
        project: "{configured_project.id}"
        headers:
          Autorization: "Token 66666666666666666666666"
          Security: "123123123123123"
    response:
      status_code: 201
      save:
        json:
          webhook_id: id
  - name: Try to update project field in webhook without changes
    request:
      url: "{django_live_url}/api/webhooks/{webhook_id}/"
      method: PATCH
      json:
        project: null
    response:
      status_code: 200
      json:
        id: !int "{webhook_id}"
        project: !int "{configured_project.id}"
        actions: !anylist
        created_at: !anystr
        updated_at: !anystr
        headers: !anydict
        send_payload: true
        send_for_all_actions: true
        organization: !int "{configured_project.organization.id}"
        is_active: true
        url: "http://127.0.0.1:6666/webhook/proj/"