Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions learning_resources/views_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ def test_featured_view_filter(client, offeror_featured_lists, parameter):
assert run["resource_prices"] == []


@pytest.mark.skip_nplusone_check
def test_similar_resources_endpoint_does_not_return_self(mocker, client):
"""Test similar learning_resources endpoint does not return initial resource"""
from learning_resources.models import LearningResource
Expand Down Expand Up @@ -1156,6 +1157,7 @@ def test_similar_resources_endpoint_does_not_return_self(mocker, client):
assert similar_for not in response_ids


@pytest.mark.skip_nplusone_check
def test_similar_resources_endpoint_only_returns_published(mocker, client):
"""Test similar learning_resources endpoint only returns published items"""
from learning_resources.models import LearningResource
Expand Down Expand Up @@ -1199,6 +1201,7 @@ def test_similar_resources_endpoint_only_returns_published(mocker, client):
assert len(response_ids) == 1


@pytest.mark.skip_nplusone_check
def test_similar_resources_endpoint_ignores_opensearch_published(mocker, client):
"""Test similar learning_resources ignores the published attribute from opensearch"""
from learning_resources.models import LearningResource
Expand Down Expand Up @@ -1271,6 +1274,7 @@ def test_vector_similar_resources_endpoint_does_not_return_self(mocker, client):
assert similar_for not in response_ids


@pytest.mark.skip_nplusone_check
def test_vector_similar_resources_endpoint_only_returns_published(mocker, client):
"""Test vector based similar resources endpoint only returns published items"""
from learning_resources.models import LearningResource
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ addopts = --cov . --cov-report term --cov-report html --cov-report xml --ds=main
norecursedirs = node_modules .git .tox static templates .* CVS _darcs {arch} *.egg
markers =
betamax: test requires betamax
skip_nplusone_check: test requires skipping n+1 query checks

# In addition to existing env variables
env =
Expand Down
Loading