Use direct mastodon host for verification

This commit is contained in:
Jake Howard 2023-07-20 22:02:02 +01:00
parent 59b7cf96fc
commit 7105386e61
Signed by: jake
GPG key ID: 57AFB45680EDD477
7 changed files with 9 additions and 24 deletions

View file

@ -17,7 +17,7 @@ class BlogPostPageTestCase(TestCase):
self.assertEqual(response.status_code, 200)
def test_queries(self) -> None:
with self.assertNumQueries(48):
with self.assertNumQueries(47):
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(45):
with self.assertNumQueries(44):
self.client.get(self.page.url)
def test_feed_accessible(self) -> None:

View file

@ -1,4 +1,4 @@
{% load static wagtailcore_tags wagtailuserbar navbar_tags footer_tags plausible_wagtail favicon_tags sri cache contact_tags %}
{% load static wagtailcore_tags wagtailuserbar navbar_tags footer_tags plausible_wagtail favicon_tags sri cache %}
<!DOCTYPE html>
<html lang="en-GB">
@ -16,7 +16,7 @@
<link rel="alternate" type="application/rss+xml" href="{% url 'feed' %}" />
{% mastodon_link %}
<link rel="me" href="https://{{ ACTIVITYPUB_HOST }}/@jake" />
<script async type="text/javascript" src="{% static 'js/ie11-deterrent.js' %}" integrity="{% sri_integrity_static 'js/ie11-deterrent.js' %}"></script>

View file

@ -35,7 +35,7 @@ class ContentPageTestCase(TestCase):
self.assertEqual(response.status_code, 200)
def test_queries(self) -> None:
with self.assertNumQueries(39):
with self.assertNumQueries(38):
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(43):
with self.assertNumQueries(42):
response = self.client.get(self.page.url)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.context["listing_pages"]), 2)

View file

@ -22,7 +22,7 @@ class Error404PageTestCase(TestCase):
)
def test_queries(self) -> None:
with self.assertNumQueries(23):
with self.assertNumQueries(22):
self.client.get(self.url)

View file

@ -1,16 +0,0 @@
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)

View file

@ -89,7 +89,7 @@ class SearchPageResultsTestCase(TestCase):
)
def test_too_high_page(self) -> None:
with self.assertNumQueries(48):
with self.assertNumQueries(47):
response = self.client.get(
self.url, {"q": "post", "page": 3}, HTTP_HX_REQUEST="true"
)

View file

@ -10,4 +10,5 @@ def global_vars(request: HttpRequest) -> dict:
"DEBUG": settings.DEBUG,
"FRAGMENT_CACHE_TTL": fragment_cache_ttl,
"FRAGMENT_CACHE_TTL_JITTER": fragment_cache_ttl * 0.1,
"ACTIVITYPUB_HOST": settings.ACTIVITYPUB_HOST,
}