diff --git a/apps/careeropportunity/tests.py b/apps/careeropportunity/tests.py index d136c4ddd..3c63bb4eb 100644 --- a/apps/careeropportunity/tests.py +++ b/apps/careeropportunity/tests.py @@ -18,7 +18,7 @@ def test_careeropportunity_index(self): response = self.client.get(url) - self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.status_code, status.HTTP_301_MOVED_PERMANENTLY) def test_careeropportunity_detail(self): past = datetime(2000, 1, 1, 1, 0, 0, 0, UTC) @@ -29,7 +29,7 @@ def test_careeropportunity_detail(self): response = self.client.get(url) - self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.status_code, status.HTTP_301_MOVED_PERMANENTLY) class CompanyAPITestCase(GetUrlMixin, APITestCase): diff --git a/apps/careeropportunity/views.py b/apps/careeropportunity/views.py index 54f921dff..9e7371e38 100644 --- a/apps/careeropportunity/views.py +++ b/apps/careeropportunity/views.py @@ -12,9 +12,9 @@ def index(request, id=None): if id: - return redirect(f"https://online.ntnu.no/career/{id}", True) + return redirect(f"https://online.ntnu.no/career/{id}", permanent=True) else: - return redirect("https://online.ntnu.no/career", True) + return redirect("https://online.ntnu.no/career", permanent=True) class HundredItemsPaginator(PageNumberPagination):