mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Merge pull request #2471 from bookwyrm-social/impressum
Adds missing template
This commit is contained in:
commit
117b86fdc0
2 changed files with 38 additions and 0 deletions
15
bookwyrm/templates/about/impressum.html
Normal file
15
bookwyrm/templates/about/impressum.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{% extends 'about/layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Impressum" %}{% endblock %}
|
||||
|
||||
|
||||
{% block about_content %}
|
||||
<div class="block content">
|
||||
<h2>{% trans "Impressum" %}</h2>
|
||||
<div class="content">
|
||||
{{ site.impressum | safe }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -1,6 +1,7 @@
|
|||
""" test for app action functionality """
|
||||
from unittest.mock import patch
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
from django.http import Http404
|
||||
from django.template.response import TemplateResponse
|
||||
from django.test import TestCase
|
||||
from django.test.client import RequestFactory
|
||||
|
@ -77,6 +78,28 @@ class LandingViews(TestCase):
|
|||
validate_html(result.render())
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
||||
def test_impressum_page_off(self):
|
||||
"""there are so many views, this just makes sure it LOADS"""
|
||||
view = views.impressum
|
||||
request = self.factory.get("")
|
||||
request.user = self.local_user
|
||||
with self.assertRaises(Http404):
|
||||
view(request)
|
||||
|
||||
def test_impressum_page_on(self):
|
||||
"""there are so many views, this just makes sure it LOADS"""
|
||||
site = models.SiteSettings.objects.get()
|
||||
site.show_impressum = True
|
||||
site.save()
|
||||
|
||||
view = views.impressum
|
||||
request = self.factory.get("")
|
||||
request.user = self.local_user
|
||||
result = view(request)
|
||||
self.assertIsInstance(result, TemplateResponse)
|
||||
validate_html(result.render())
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
||||
def test_landing(self):
|
||||
"""there are so many views, this just makes sure it LOADS"""
|
||||
view = views.Landing.as_view()
|
||||
|
|
Loading…
Reference in a new issue