Move well-known templates to well-known app
This commit is contained in:
parent
82e7a00d8a
commit
37ab598d0d
7 changed files with 8 additions and 8 deletions
|
@ -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(17):
|
with self.assertNumQueries(21):
|
||||||
self.client.get(self.page.url)
|
self.client.get(self.page.url)
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,5 +57,5 @@ class ListingPageTestCase(TestCase):
|
||||||
self.assertEqual(len(response.context["child_pages"]), 2)
|
self.assertEqual(len(response.context["child_pages"]), 2)
|
||||||
|
|
||||||
def test_queries(self) -> None:
|
def test_queries(self) -> None:
|
||||||
with self.assertNumQueries(20):
|
with self.assertNumQueries(24):
|
||||||
self.client.get(self.page.url)
|
self.client.get(self.page.url)
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Error404PageTestCase(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_queries(self) -> None:
|
def test_queries(self) -> None:
|
||||||
with self.assertNumQueries(8):
|
with self.assertNumQueries(12):
|
||||||
self.client.get(self.url)
|
self.client.get(self.url)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class MatrixServerViewTestCase(SimpleTestCase):
|
||||||
response = self.client.get(self.url)
|
response = self.client.get(self.url)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertEqual(response["Content-Type"], "application/json")
|
self.assertEqual(response["Content-Type"], "application/json")
|
||||||
self.assertTemplateUsed(response, "matrix-server.json")
|
self.assertTemplateUsed(response, "well-known/matrix-server.json")
|
||||||
|
|
||||||
|
|
||||||
class MatrixClientViewTestCase(SimpleTestCase):
|
class MatrixClientViewTestCase(SimpleTestCase):
|
||||||
|
@ -35,4 +35,4 @@ class MatrixClientViewTestCase(SimpleTestCase):
|
||||||
response = self.client.get(self.url)
|
response = self.client.get(self.url)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertEqual(response["Content-Type"], "application/json")
|
self.assertEqual(response["Content-Type"], "application/json")
|
||||||
self.assertTemplateUsed(response, "matrix-client.json")
|
self.assertTemplateUsed(response, "well-known/matrix-client.json")
|
||||||
|
|
|
@ -11,7 +11,7 @@ from website.contact.models import ContactPage
|
||||||
|
|
||||||
|
|
||||||
class SecurityView(TemplateView):
|
class SecurityView(TemplateView):
|
||||||
template_name = "security.txt"
|
template_name = "well-known/security.txt"
|
||||||
content_type = "text/plain"
|
content_type = "text/plain"
|
||||||
|
|
||||||
expires = timedelta(days=7)
|
expires = timedelta(days=7)
|
||||||
|
@ -32,11 +32,11 @@ class SecurityView(TemplateView):
|
||||||
|
|
||||||
@method_decorator(cache_page(60 * 60), name="dispatch")
|
@method_decorator(cache_page(60 * 60), name="dispatch")
|
||||||
class MatrixServerView(TemplateView):
|
class MatrixServerView(TemplateView):
|
||||||
template_name = "matrix-server.json"
|
template_name = "well-known/matrix-server.json"
|
||||||
content_type = "application/json"
|
content_type = "application/json"
|
||||||
|
|
||||||
|
|
||||||
@method_decorator(cache_page(60 * 60), name="dispatch")
|
@method_decorator(cache_page(60 * 60), name="dispatch")
|
||||||
class MatrixClientView(TemplateView):
|
class MatrixClientView(TemplateView):
|
||||||
template_name = "matrix-client.json"
|
template_name = "well-known/matrix-client.json"
|
||||||
content_type = "application/json"
|
content_type = "application/json"
|
||||||
|
|
Loading…
Reference in a new issue