Skip to content

Commit e5f7ff2

Browse files
authored
Merge branch 'main' into PPHA-686-adding-Diagnostic-settings
2 parents 5bae2c0 + 141f692 commit e5f7ff2

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
)

lung_cancer_screening/questions/views/book_an_appointment.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from django.shortcuts import render
22
from 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,

0 commit comments

Comments
 (0)