vella-backend / tests /test_custom_exception_handler.py
luanpoppe
feat: refatorando arquivos com funções úteis do langchain
eebeb78
raw
history blame contribute delete
727 Bytes
import pytest
import os
from _utils.langchain_utils.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