Add mastodon verification link
This commit is contained in:
parent
a5d5f828c0
commit
f90c25d132
6 changed files with 25 additions and 7 deletions
|
@ -17,7 +17,7 @@ class BlogPostPageTestCase(TestCase):
|
|||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_queries(self) -> None:
|
||||
with self.assertNumQueries(47):
|
||||
with self.assertNumQueries(48):
|
||||
self.client.get(self.page.url)
|
||||
|
||||
|
||||
|
@ -76,7 +76,7 @@ class BlogPostListPageTestCase(TestCase):
|
|||
self.assertContains(response, self.page.reverse_subpage("feed"))
|
||||
|
||||
def test_queries(self) -> None:
|
||||
with self.assertNumQueries(44):
|
||||
with self.assertNumQueries(45):
|
||||
self.client.get(self.page.url)
|
||||
|
||||
def test_feed_accessible(self) -> None:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% load static wagtailcore_tags wagtailuserbar navbar_tags footer_tags plausible_wagtail favicon_tags sri cache %}
|
||||
{% load static wagtailcore_tags wagtailuserbar navbar_tags footer_tags plausible_wagtail favicon_tags sri cache contact_tags %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-GB">
|
||||
|
@ -16,6 +16,8 @@
|
|||
|
||||
<link rel="alternate" type="application/rss+xml" href="{% url 'feed' %}" />
|
||||
|
||||
{% mastodon_link %}
|
||||
|
||||
<script async type="text/javascript" src="{% static 'js/ie11-deterrent.js' %}" integrity="{% sri_integrity_static 'js/ie11-deterrent.js' %}"></script>
|
||||
|
||||
{% sri_static "css/base.css" %}
|
||||
|
|
|
@ -35,7 +35,7 @@ class ContentPageTestCase(TestCase):
|
|||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_queries(self) -> None:
|
||||
with self.assertNumQueries(38):
|
||||
with self.assertNumQueries(39):
|
||||
self.client.get(self.page.url)
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ class ListingPageTestCase(TestCase):
|
|||
ContentPageFactory(parent=cls.page)
|
||||
|
||||
def test_accessible(self) -> None:
|
||||
with self.assertNumQueries(42):
|
||||
with self.assertNumQueries(43):
|
||||
response = self.client.get(self.page.url)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(len(response.context["listing_pages"]), 2)
|
||||
|
|
|
@ -22,7 +22,7 @@ class Error404PageTestCase(TestCase):
|
|||
)
|
||||
|
||||
def test_queries(self) -> None:
|
||||
with self.assertNumQueries(22):
|
||||
with self.assertNumQueries(23):
|
||||
self.client.get(self.url)
|
||||
|
||||
|
||||
|
|
16
website/contact/templatetags/contact_tags.py
Normal file
16
website/contact/templatetags/contact_tags.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from django.template import Library
|
||||
from django.utils.html import format_html
|
||||
|
||||
from website.contact.models import OnlineAccount
|
||||
|
||||
register = Library()
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def mastodon_link() -> str:
|
||||
mastodon_account = OnlineAccount.objects.filter(name__iexact="mastodon").first()
|
||||
|
||||
if mastodon_account is None:
|
||||
return ""
|
||||
|
||||
return format_html('<link rel="me" href="{}" />', mastodon_account.url)
|
|
@ -89,7 +89,7 @@ class SearchPageResultsTestCase(TestCase):
|
|||
)
|
||||
|
||||
def test_too_high_page(self) -> None:
|
||||
with self.assertNumQueries(47):
|
||||
with self.assertNumQueries(48):
|
||||
response = self.client.get(
|
||||
self.url, {"q": "post", "page": 3}, HTTP_HX_REQUEST="true"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue