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
1 change: 1 addition & 0 deletions openedx_tagging/core/tagging/rest_api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class TaxonomyView(ModelViewSet):

"""

lookup_value_regex = r"\d+"
serializer_class = TaxonomySerializer
permission_classes = [TaxonomyObjectPermissions]

Expand Down
7 changes: 7 additions & 0 deletions tests/openedx_tagging/core/tagging/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ def test_detail_taxonomy_404(self) -> None:
response = self.client.get(url)
assert response.status_code == status.HTTP_404_NOT_FOUND

def test_detail_taxonomy_invalud_pk(self) -> None:
url = TAXONOMY_DETAIL_URL.format(pk="invalid")

self.client.force_authenticate(user=self.staff)
response = self.client.get(url)
assert response.status_code == status.HTTP_404_NOT_FOUND

@ddt.data(
(None, status.HTTP_401_UNAUTHORIZED),
("user", status.HTTP_403_FORBIDDEN),
Expand Down