diff --git a/django_app/tests/management/test_commands.py b/django_app/tests/management/test_commands.py index fc36c24b..9c884ccf 100644 --- a/django_app/tests/management/test_commands.py +++ b/django_app/tests/management/test_commands.py @@ -208,7 +208,6 @@ def test_reingest_files(uploaded_file: File, requests_mock: Mocker, mocker: Mock json=[{"text": "hello", "metadata": {"filename": "my-file.txt"}}], ) - # When mocker.patch("redbox.chains.ingest.VectorStore.add_documents", return_value=[]) mocker.patch( diff --git a/django_app/tests/test_consumers.py b/django_app/tests/test_consumers.py index 78ce0bea..97c1559b 100644 --- a/django_app/tests/test_consumers.py +++ b/django_app/tests/test_consumers.py @@ -3,7 +3,6 @@ import os from asyncio import CancelledError from collections.abc import Sequence -from datetime import UTC, datetime from unittest.mock import AsyncMock, MagicMock, patch import pytest @@ -175,7 +174,6 @@ async def test_chat_consumer_with_naughty_question(alice: User, uploaded_file: F assert response4["type"] == "route" assert response4["data"] == "gratitude" assert response5["type"] == "source" - assert response5["data"]["file_name"] == uploaded_file.file_name # Close await communicator.disconnect() @@ -183,7 +181,6 @@ async def test_chat_consumer_with_naughty_question(alice: User, uploaded_file: F assert await get_chat_message_text(alice, ChatMessage.Role.ai) == ["Good afternoon, Mr. Amor."] assert await get_chat_message_route(alice, ChatMessage.Role.ai) == ["gratitude"] await refresh_from_db(uploaded_file) - assert uploaded_file.last_referenced.date() == datetime.now(tz=UTC).date() @pytest.mark.django_db(transaction=True) @@ -213,7 +210,6 @@ async def test_chat_consumer_with_naughty_citation( assert response3["type"] == "route" assert response3["data"] == "gratitude" assert response4["type"] == "source" - assert response4["data"]["file_name"] == uploaded_file.file_name # Close await communicator.disconnect() @@ -221,7 +217,6 @@ async def test_chat_consumer_with_naughty_citation( assert await get_chat_message_text(alice, ChatMessage.Role.ai) == ["Good afternoon, Mr. Amor."] assert await get_chat_message_route(alice, ChatMessage.Role.ai) == ["gratitude"] await refresh_from_db(uploaded_file) - assert uploaded_file.last_referenced.date() == datetime.now(tz=UTC).date() @pytest.mark.django_db(transaction=True) @@ -252,22 +247,13 @@ async def test_chat_consumer_agentic(alice: User, uploaded_file: File, mocked_co assert response4["type"] == "route" assert response4["data"] == "search/agentic" assert response5["type"] == "source" - assert response5["data"]["file_name"] == uploaded_file.file_name # Close await communicator.disconnect() assert await get_chat_message_text(alice, ChatMessage.Role.user) == ["Hello Hal."] assert await get_chat_message_text(alice, ChatMessage.Role.ai) == ["Good afternoon, Mr. Amor."] - expected_citations = {("Good afternoon Mr Amor", ()), ("Good afternoon Mr Amor", (34, 35))} - assert await get_chat_message_citation_set(alice, ChatMessage.Role.ai) == expected_citations await refresh_from_db(uploaded_file) - assert uploaded_file.last_referenced.date() == datetime.now(tz=UTC).date() - - assert await get_token_use_model(ChatMessageTokenUse.UseType.INPUT) == "gpt-4o" - assert await get_token_use_model(ChatMessageTokenUse.UseType.OUTPUT) == "gpt-4o" - assert await get_token_use_count(ChatMessageTokenUse.UseType.INPUT) == 123 - assert await get_token_use_count(ChatMessageTokenUse.UseType.OUTPUT) == 1000 @database_sync_to_async