File tree Expand file tree Collapse file tree
lung_cancer_screening/questions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from django .test import TestCase , tag
2+ from django .urls import reverse
3+
4+ from .helpers .authentication import login_user
5+
6+ @tag ("BookAnAppointment" )
7+ class TestGetBookAnAppointment (TestCase ):
8+ def setUp (self ):
9+ self .user = login_user (self .client )
10+
11+ def test_get_redirects_if_the_user_is_not_logged_in (self ):
12+ self .client .logout ()
13+
14+ response = self .client .get (reverse ("questions:book_an_appointment" ))
15+
16+ self .assertRedirects (
17+ response ,
18+ "/oidc/authenticate/?next=/call-us-to-book-an-appointment" ,
19+ fetch_redirect_response = False ,
20+ )
Original file line number Diff line number Diff line change 11from django .shortcuts import render
22from django .views import View
3+ from django .contrib .auth .mixins import LoginRequiredMixin
34
4- from .mixins .ensure_response_set import EnsureResponseSet
55
6-
7- class BookAnAppointmentExitView (EnsureResponseSet , View ):
6+ class BookAnAppointmentExitView (LoginRequiredMixin , View ):
87 def get (self , request ):
98 return render (
109 request ,
You can’t perform that action at this time.
0 commit comments