Skip to content

Commit

Permalink
Fix swagger path
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Oct 30, 2024
1 parent b71be01 commit 47554a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions config/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"default": {
"BACKEND": "django.core.cache.backends.dummy.DummyCache",
},
"local_storage": {
"BACKEND": "django.core.cache.backends.dummy.DummyCache",
},
}

# PASSWORDS
Expand Down
6 changes: 3 additions & 3 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.conf.urls import include
from django.contrib import admin
from django.http import HttpResponse
from django.urls import path
from django.urls import path, re_path
from django.views import defaults as default_views
from django.views.decorators.cache import cache_page

Expand All @@ -21,8 +21,8 @@
),
name="schema-swagger-ui",
),
path(
r"schema/",
re_path(
r"^schema\/(?:\?format=(?P<format>json|yaml))?$",
cache_page(schema_cache_timeout, cache="local_storage")(
SpectacularAPIView().as_view()
),
Expand Down
2 changes: 1 addition & 1 deletion safe_transaction_service/history/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_about_view(self):
self.assertEqual(response.status_code, status.HTTP_200_OK)

def test_swagger_json_schema(self):
url = reverse("schema-json", args=(".json",))
url = reverse("schema-json") + "?format=json"
response = self.client.get(url, format="json")
self.assertEqual(response.status_code, status.HTTP_200_OK)

Expand Down

0 comments on commit 47554a6

Please sign in to comment.