Use direct mastodon host for verification
This commit is contained in:
parent
59b7cf96fc
commit
7105386e61
7 changed files with 9 additions and 24 deletions
|
@ -17,7 +17,7 @@ class BlogPostPageTestCase(TestCase):
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
def test_queries(self) -> None:
|
def test_queries(self) -> None:
|
||||||
with self.assertNumQueries(48):
|
with self.assertNumQueries(47):
|
||||||
self.client.get(self.page.url)
|
self.client.get(self.page.url)
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ class BlogPostListPageTestCase(TestCase):
|
||||||
self.assertContains(response, self.page.reverse_subpage("feed"))
|
self.assertContains(response, self.page.reverse_subpage("feed"))
|
||||||
|
|
||||||
def test_queries(self) -> None:
|
def test_queries(self) -> None:
|
||||||
with self.assertNumQueries(45):
|
with self.assertNumQueries(44):
|
||||||
self.client.get(self.page.url)
|
self.client.get(self.page.url)
|
||||||
|
|
||||||
def test_feed_accessible(self) -> None:
|
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 contact_tags %}
|
{% load static wagtailcore_tags wagtailuserbar navbar_tags footer_tags plausible_wagtail favicon_tags sri cache %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en-GB">
|
<html lang="en-GB">
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
<link rel="alternate" type="application/rss+xml" href="{% url 'feed' %}" />
|
<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>
|
<script async type="text/javascript" src="{% static 'js/ie11-deterrent.js' %}" integrity="{% sri_integrity_static 'js/ie11-deterrent.js' %}"></script>
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class ContentPageTestCase(TestCase):
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
def test_queries(self) -> None:
|
def test_queries(self) -> None:
|
||||||
with self.assertNumQueries(39):
|
with self.assertNumQueries(38):
|
||||||
self.client.get(self.page.url)
|
self.client.get(self.page.url)
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class ListingPageTestCase(TestCase):
|
||||||
ContentPageFactory(parent=cls.page)
|
ContentPageFactory(parent=cls.page)
|
||||||
|
|
||||||
def test_accessible(self) -> None:
|
def test_accessible(self) -> None:
|
||||||
with self.assertNumQueries(43):
|
with self.assertNumQueries(42):
|
||||||
response = self.client.get(self.page.url)
|
response = self.client.get(self.page.url)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertEqual(len(response.context["listing_pages"]), 2)
|
self.assertEqual(len(response.context["listing_pages"]), 2)
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Error404PageTestCase(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_queries(self) -> None:
|
def test_queries(self) -> None:
|
||||||
with self.assertNumQueries(23):
|
with self.assertNumQueries(22):
|
||||||
self.client.get(self.url)
|
self.client.get(self.url)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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)
|
|
|
@ -89,7 +89,7 @@ class SearchPageResultsTestCase(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_too_high_page(self) -> None:
|
def test_too_high_page(self) -> None:
|
||||||
with self.assertNumQueries(48):
|
with self.assertNumQueries(47):
|
||||||
response = self.client.get(
|
response = self.client.get(
|
||||||
self.url, {"q": "post", "page": 3}, HTTP_HX_REQUEST="true"
|
self.url, {"q": "post", "page": 3}, HTTP_HX_REQUEST="true"
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,4 +10,5 @@ def global_vars(request: HttpRequest) -> dict:
|
||||||
"DEBUG": settings.DEBUG,
|
"DEBUG": settings.DEBUG,
|
||||||
"FRAGMENT_CACHE_TTL": fragment_cache_ttl,
|
"FRAGMENT_CACHE_TTL": fragment_cache_ttl,
|
||||||
"FRAGMENT_CACHE_TTL_JITTER": fragment_cache_ttl * 0.1,
|
"FRAGMENT_CACHE_TTL_JITTER": fragment_cache_ttl * 0.1,
|
||||||
|
"ACTIVITYPUB_HOST": settings.ACTIVITYPUB_HOST,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue