diff options
Diffstat (limited to '')
-rw-r--r-- | instruments/tests/test_views.py | 2 | ||||
-rw-r--r-- | instruments/views.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/instruments/tests/test_views.py b/instruments/tests/test_views.py index 048ab47..e1573a2 100644 --- a/instruments/tests/test_views.py +++ b/instruments/tests/test_views.py @@ -7,4 +7,4 @@ pytestmark = pytest.mark.django_db def test_view_url_exists_at_desired_location(client): url = reverse("instruments:sop-list") response = client.get(url) - assert response.status_code == 200 + assert response.status_code == 302 diff --git a/instruments/views.py b/instruments/views.py index 0329e00..37ec69f 100644 --- a/instruments/views.py +++ b/instruments/views.py @@ -1,10 +1,11 @@ # from django.shortcuts import render +from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic.list import ListView from .models import SOP -class SOPListView(ListView): +class SOPListView(LoginRequiredMixin, ListView): model = SOP paginate_by = 100 |