Bin
2025-12-16 7423b0c6e1959f30a7e8e453e953310f32ce13c6
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
# ---
 
# test_name: test_docs
 
# strict: False
 
# marks:
#   - usefixtures:
#        - django_live_url
 
# stages:
#   - name: signup
#     request:
#       url: "{django_live_url}/user/signup"
#       data:
#         email: test_suites_user@heartex.com
#         password: 12345678
#       method: POST
#     response:
#       status_code: 302
#   - name: get_docs
#     request:
#       url: "{django_live_url}/docs/api?format=openapi"
#       method: GET
#     response:
#       status_code: 200
#       verify_response_with:
#         function: tests.utils:verify_docs
import pytest
from organizations.tests.factories import OrganizationFactory
from rest_framework.test import APIClient
from tests.utils import verify_docs
 
 
@pytest.mark.django_db
def test_docs():
    organization = OrganizationFactory()
    user = organization.created_by
    client = APIClient()
    client.force_authenticate(user)
 
    response = client.get('/docs/api?format=openapi', follow=True)
    assert response.status_code == 200
    verify_docs(response)