mirror of
https://github.com/jazzband/django-constance.git
synced 2026-05-08 15:44:47 +00:00
Used url template tag for history
This commit is contained in:
parent
e0d406d0a4
commit
e760dcc80f
2 changed files with 5 additions and 2 deletions
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
{% block content %}
|
||||
<ul class="object-tools">
|
||||
<li><a href="history/" class="historylink">{% trans 'History' %}</a></li>
|
||||
<li><a href="{% url 'admin:constance_config_history' %}" class="historylink">{% trans 'History' %}</a></li>
|
||||
</ul>
|
||||
<div id="content-main" class="constance">
|
||||
<div class="module" id="changelist">
|
||||
|
|
|
|||
|
|
@ -448,12 +448,15 @@ class TestAdmin(TestCase):
|
|||
|
||||
def test_changelist_has_history_link(self):
|
||||
"""Test that the changelist page contains a link to the history view."""
|
||||
from django.urls import reverse
|
||||
|
||||
request = self.rf.get("/admin/constance/config/")
|
||||
request.user = self.superuser
|
||||
response = self.options.changelist_view(request)
|
||||
response.render()
|
||||
content = response.content.decode()
|
||||
self.assertIn('href="history/"', content)
|
||||
history_url = reverse("admin:constance_config_history")
|
||||
self.assertIn(f'href="{history_url}"', content)
|
||||
self.assertIn("History", content)
|
||||
|
||||
def test_change_url_redirects_to_changelist(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue