From c932b0059135a575b842411a955dc1756970fcc6 Mon Sep 17 00:00:00 2001 From: vladsg Date: Sat, 26 Oct 2024 16:14:17 +0300 Subject: [PATCH 1/2] fix schema urls --- swapi/urls.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/swapi/urls.py b/swapi/urls.py index 3247befc..aa4eb065 100644 --- a/swapi/urls.py +++ b/swapi/urls.py @@ -25,11 +25,11 @@ url(r"^about$", "swapi.views.about"), url(r"^stats$", "swapi.views.stats"), url(r"^stripe/donation", "swapi.views.stripe_donation"), - url(r"^api/people/schema$", "resources.schemas.people"), - url(r"^api/planets/schema$", "resources.schemas.planets"), - url(r"^api/films/schema$", "resources.schemas.films"), - url(r"^api/species/schema$", "resources.schemas.species"), - url(r"^api/vehicles/schema$", "resources.schemas.vehicles"), - url(r"^api/starships/schema$", "resources.schemas.starships"), + url(r"^api/people/schema/?$", "resources.schemas.people"), + url(r"^api/planets/schema/?$", "resources.schemas.planets"), + url(r"^api/films/schema/?$", "resources.schemas.films"), + url(r"^api/species/schema/?$", "resources.schemas.species"), + url(r"^api/vehicles/schema/?$", "resources.schemas.vehicles"), + url(r"^api/starships/schema/?$", "resources.schemas.starships"), url(r"^api/", include(router.urls)), ) From 558ea2e283e015784faf83c05c0be312db2dbe5b Mon Sep 17 00:00:00 2001 From: vladsg Date: Sat, 26 Oct 2024 16:15:24 +0300 Subject: [PATCH 2/2] fix tests --- resources/tests.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/tests.py b/resources/tests.py index 4b3f6373..02b1b4f4 100644 --- a/resources/tests.py +++ b/resources/tests.py @@ -40,7 +40,7 @@ def test_people_root(self): def test_people_schema(self): self.assertEqual( - self.get_query("/api/people/schema").status_code, 200) + self.get_query("/api/people/schema/").status_code, 200) def test_people_search(self): response = self.get_query("/api/people/?search=r2") @@ -59,7 +59,7 @@ def test_planets_root(self): def test_planets_schema(self): self.assertEqual( - self.get_query("/api/planets/schema").status_code, 200) + self.get_query("/api/planets/schema/").status_code, 200) def test_planets_search(self): response = self.get_query("/api/planets/?search=yavin") @@ -78,7 +78,7 @@ def test_films_root(self): def test_films_schema(self): self.assertEqual( - self.get_query("/api/films/schema").status_code, 200) + self.get_query("/api/films/schema/").status_code, 200) def test_films_search(self): response = self.get_query("/api/films/?search=sith") @@ -97,7 +97,7 @@ def test_starships_root(self): def test_starship_schema(self): self.assertEqual( - self.get_query("/api/starships/schema").status_code, 200) + self.get_query("/api/starships/schema/").status_code, 200) def test_starship_search(self): response = self.get_query("/api/starships/?search=x1") @@ -116,7 +116,7 @@ def test_vehicles_root(self): def test_vehicle_schema(self): self.assertEqual( - self.get_query("/api/vehicles/schema").status_code, 200) + self.get_query("/api/vehicles/schema/").status_code, 200) def test_vehicle_search(self): response = self.get_query("/api/vehicles/?search=crawler") @@ -135,7 +135,7 @@ def test_species_root(self): def test_species_schema(self): self.assertEqual( - self.get_query("/api/species/schema").status_code, 200) + self.get_query("/api/species/schema/").status_code, 200) def test_species_search(self): response = self.get_query("/api/species/?search=calamari")