add an about page (and some mroe tests)
This commit is contained in:
@@ -158,6 +158,7 @@ urlpatterns = [
|
||||
path("cookies/", include("cookie_consent.urls")),
|
||||
#path("cookies/", include("cookie_consent.urls")),
|
||||
path("privacy/", views.privacy_view, name="privacy"),
|
||||
path("about/", views.about_view, name="about"),
|
||||
# path('select2/', include('select2.urls')),
|
||||
*HTMXAutoComplete.url_dispatcher('ac'),
|
||||
]
|
||||
|
||||
@@ -506,6 +506,8 @@ def view_feedback(request):
|
||||
def privacy_view(request):
|
||||
return render(request, "privacy.html")
|
||||
|
||||
def about_view(request):
|
||||
return render(request, "about.html")
|
||||
|
||||
# HTTP Error 400
|
||||
def page_not_found(request, exception):
|
||||
|
||||
@@ -334,3 +334,31 @@ def test_supervisor_management(db, faker, client, create_cid_manager, django_use
|
||||
|
||||
soup = BeautifulSoup(response.content, "html.parser")
|
||||
assert len(soup.find(id="supervisor-list").find_all("li")) == 1
|
||||
|
||||
response = client.post(reverse(f"generic:supervisor_create"), {"email":faker.email(), "name": faker.name()})
|
||||
assert response.status_code == 302
|
||||
|
||||
response = client.get(reverse(f"generic:supervisor"))
|
||||
assert response.status_code == 200
|
||||
|
||||
soup = BeautifulSoup(response.content, "html.parser")
|
||||
assert len(soup.find(id="supervisor-list").find_all("li")) == 2
|
||||
|
||||
|
||||
def test_privacy(db, client):
|
||||
response = client.get(reverse(f"privacy"))
|
||||
assert response.status_code == 200
|
||||
|
||||
soup = BeautifulSoup(response.content, "html.parser")
|
||||
assert "Privacy Policy" in soup.find("h1").text
|
||||
|
||||
def test_cookies(db, client):
|
||||
response = client.get(reverse(f"cookie_consent_cookie_group_list"))
|
||||
assert response.status_code == 200
|
||||
|
||||
soup = BeautifulSoup(response.content, "html.parser")
|
||||
assert "Cookies" in soup.find("h1").text
|
||||
|
||||
# Check our 2 cookies are displayed (we would have to add them for this to work)
|
||||
#assert "csrftoken" in [i.text for i in soup.find_all("th")]
|
||||
#assert "sessionid" in [i.text for i in soup.find_all("th")]
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="anatomy">
|
||||
<h1>About</h1>
|
||||
|
||||
<p>Developed for / as part of the <a href="https://www.penra.org.uk/">Peninsula Radiology Academy</a>.</p>
|
||||
<p>Click <a href="https://www.penra.org.uk/courses-at-the-academy/">here for upcoming courses / open days.</a></p>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -139,6 +139,7 @@
|
||||
<ul class="nav col-md-4 justify-content-end list-unstyled d-flex">
|
||||
<li class="ms-3"><a class="text-muted" href="{% url 'privacy' %}">Privacy</a></li>
|
||||
<li class="ms-3"><a class="text-muted" href="{% url 'cookie_consent_cookie_group_list' %}">Cookies</a></li>
|
||||
<li class="ms-3"><a class="text-muted" href="{% url 'about' %}">About</a></li>
|
||||
</ul>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user