diff --git a/indigo_api/tests/test_document_api.py b/indigo_api/tests/test_document_api.py index f61a16ab7..c94d6ccf2 100644 --- a/indigo_api/tests/test_document_api.py +++ b/indigo_api/tests/test_document_api.py @@ -1,5 +1,5 @@ import tempfile -from mock import patch +from unittest.mock import patch import datetime from nose.tools import * # noqa diff --git a/indigo_content_api/tests/v2/test_content_api.py b/indigo_content_api/tests/v2/test_content_api.py index 90e5ddad6..e14250677 100644 --- a/indigo_content_api/tests/v2/test_content_api.py +++ b/indigo_content_api/tests/v2/test_content_api.py @@ -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 diff --git a/indigo_content_api/v3/views.py b/indigo_content_api/v3/views.py index a2fa1aad7..b0959ba38 100644 --- a/indigo_content_api/v3/views.py +++ b/indigo_content_api/v3/views.py @@ -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) diff --git a/pyproject.toml b/pyproject.toml index a3298f343..d690fd170 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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",