Spaces:
Running
Running
import pytest | |
import os | |
from _utils.splitters.Splitter_class import Splitter | |
from _utils.models.gerar_relatorio import ( | |
DocumentChunk, | |
) | |
from rest_framework import status | |
from rest_framework.exceptions import ValidationError | |
from rest_framework.test import APIClient | |
from django.core.handlers.wsgi import WSGIRequest | |
# class TestCustomExceptionHandler: | |
# @pytest.mark.django_db | |
# @pytest.mark.asyncio | |
# def test_function_that_raises(self): | |
# client = APIClient() | |
# invalid_data = { | |
# "name": "wrong property" | |
# } | |
# response = client.post('/gerar-documento', invalid_data, format='json') | |
# assert response.status_code == status.HTTP_400_BAD_REQUEST | |