Skip to content

Commit ade355f

Browse files
authored
Fix python unit test (#2629)
1 parent e2abf22 commit ade355f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

learning_resources/views_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,7 @@ def test_featured_view_filter(client, offeror_featured_lists, parameter):
11211121
assert run["resource_prices"] == []
11221122

11231123

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

11581159

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

12011203

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

12731276

1277+
@pytest.mark.skip_nplusone_check
12741278
def test_vector_similar_resources_endpoint_only_returns_published(mocker, client):
12751279
"""Test vector based similar resources endpoint only returns published items"""
12761280
from learning_resources.models import LearningResource

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ addopts = --cov . --cov-report term --cov-report html --cov-report xml --ds=main
33
norecursedirs = node_modules .git .tox static templates .* CVS _darcs {arch} *.egg
44
markers =
55
betamax: test requires betamax
6+
skip_nplusone_check: test requires skipping n+1 query checks
67

78
# In addition to existing env variables
89
env =

0 commit comments

Comments
 (0)