Skip to content

Commit

Permalink
Merge pull request #2207 from laws-africa/tests
Browse files Browse the repository at this point in the history
Taxonomy topic view adjustments
  • Loading branch information
longhotsummer authored Aug 23, 2024
2 parents 103d566 + a12d177 commit 9afcf02
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion indigo_api/tests/test_document_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import tempfile
from mock import patch
from unittest.mock import patch
import datetime

from nose.tools import * # noqa
Expand Down
2 changes: 1 addition & 1 deletion indigo_content_api/tests/v2/test_content_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tempfile
from datetime import date
from unittest.mock import patch

from mock import patch
from django.test.utils import override_settings
from django.conf import settings
from rest_framework.test import APITestCase
Expand Down
2 changes: 1 addition & 1 deletion indigo_content_api/v3/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_taxonomy_topic(self, slug):
def get_queryset(self):
queryset = PublishedDocumentDetailViewV3.queryset
# when drf-spectacular generates the schema, it doesn't have the taxonomy_topic attribute
if not getattr(self, 'swagger_fake_view', False):
if not getattr(self, 'swagger_fake_view', False) and self.taxonomy_topic:
works = Work.objects.filter(taxonomy_topics__path__startswith=self.taxonomy_topic.path).distinct("pk")
queryset = queryset.filter(work__in=works)
return super().filter_queryset(queryset)
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,11 @@ dev = [
"nose",
"flake8",
"django-nose>=1.4.4",
"mock>=1.3.0",
]
test = [
"nose",
"flake8",
"django-nose>=1.4.4",
"mock>=1.3.0",
"coveralls",
"django-webtest>=1.9.4",
"dotmap>=1.3.8",
Expand Down

0 comments on commit 9afcf02

Please sign in to comment.