Skip to content

Commit

Permalink
Use adit-radis-shared testing helpers instead of fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed Dec 25, 2024
1 parent 018f041 commit 87f3301
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "AGPL-3.0-or-later"
readme = "README.md"

[tool.poetry.dependencies]
adit-radis-shared = { git = "https://github.com/openradx/adit-radis-shared.git", tag = "0.9.6" }
adit-radis-shared = { git = "https://github.com/openradx/adit-radis-shared.git", tag = "0.11.0" }
adrf = "^0.1.4"
aiofiles = "^24.1.0"
asyncinotify = "^4.0.1"
Expand Down
3 changes: 2 additions & 1 deletion radis/rag/tests/unit/test_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
from django.db import close_old_connections
from pytest_mock import MockerFixture

from radis.chats.utils.testing_helpers import create_async_openai_client_mock
from radis.rag.models import Answer, RagInstance
Expand All @@ -10,7 +11,7 @@


@pytest.mark.django_db(transaction=True)
def test_rag_task_processor(mocker):
def test_rag_task_processor(mocker: MockerFixture):
num_rag_instances = 5
num_questions = 5
rag_task = create_rag_task(
Expand Down
6 changes: 3 additions & 3 deletions radis/rag/utils/testing_helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Literal

from adit_radis_shared.accounts.factories import GroupFactory, UserFactory
from adit_radis_shared.common.utils.testing_helpers import add_user_to_group

from radis.rag.factories import QuestionFactory, RagInstanceFactory, RagJobFactory, RagTaskFactory
from radis.rag.models import RagJob, RagTask
Expand All @@ -15,10 +16,9 @@ def create_rag_task(
) -> RagTask:
language = LanguageFactory.create(code=language_code)

# TODO: activate group
group = GroupFactory()
user = UserFactory()
user.groups.add(group)
group = GroupFactory()
add_user_to_group(user, group)
job = RagJobFactory.create(
status=RagJob.Status.PENDING,
owner_id=user.id,
Expand Down

0 comments on commit 87f3301

Please sign in to comment.