Bin
2025-12-17 d616898802dfe7e5dd648bcf53c6d1f86b6d3642
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
---
test_name: test_users
strict: false
marks:
- usefixtures:
  - django_live_url
stages:
- id: signup
  type: ref
 
- id: get_my_user
  type: ref
 
- name: stage
  request:
    method: GET
    url: '{django_live_url}/api/users'
  response:
    status_code: 200
 
- name: stage
  request:
    method: GET
    url: '{django_live_url}/api/users/{user_pk}'
  response:
    status_code: 200
    save:
      json:
        org_pk: active_organization
 
- name: stage
  request:
    json:
      email: test_user@heartextest.com
      username: test user
      active_organization: !int '{org_pk}'
    method: POST
    url: '{django_live_url}/api/users'
  response:
    save:
      json:
        new_user_pk: id
    status_code: 201
 
- name: stage
  request:
    method: GET
    url: '{django_live_url}/api/users/{new_user_pk}'
  response:
    status_code: 200
 
- name: attempt_update_email_raises_405
  request:
    url: "{django_live_url}/api/users/{new_user_pk}"
    json:
      email: test_user_new_email_change@heartextest.com
    method: PATCH
    headers:
      content-type: application/json
  response:
    status_code: 405
 
---
test_name: test_users_malicious_redirect
strict: false
marks:
- usefixtures:
  - django_live_url
stages:
  - name: malicious_signup
    request:
      url: "{django_live_url}/user/signup?next=http://malicious.com"
      data:
        email: test_second_org@heartex.com
        password: 12345678
      method: POST
    response:
      status_code: 302
      headers:
        location: "/" # redirect to home page rather than malicious.com
 
  - name: malicious_login
    request:
      url: "{django_live_url}/user/login?next=http://malicious.com"
      data:
        email: test_second_org@heartex.com
        password: 12345678
      method: POST
    response:
      status_code: 302
      headers:
        location: "/" # redirect to home page rather than malicious.com