mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-07-04 06:42:13 +02:00
fix logout test
This commit is contained in:
@ -44,7 +44,7 @@ class TemplateLoggedInTests(TestCase):
|
|||||||
self.assertRedirects(response, settings.LOGIN_REDIRECT_URL, 302, 302)
|
self.assertRedirects(response, settings.LOGIN_REDIRECT_URL, 302, 302)
|
||||||
|
|
||||||
def test_logout(self):
|
def test_logout(self):
|
||||||
response = self.client.get(reverse("logout"))
|
response = self.client.post(reverse("logout"))
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
def test_admin_index(self):
|
def test_admin_index(self):
|
||||||
|
@ -138,9 +138,12 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
<a class="dropdown-item" href="{% url 'member:user_detail' pk=request.user.pk %}">
|
<a class="dropdown-item" href="{% url 'member:user_detail' pk=request.user.pk %}">
|
||||||
<i class="fa fa-user"></i> {% trans "My account" %}
|
<i class="fa fa-user"></i> {% trans "My account" %}
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item" href="{% url 'logout' %}">
|
<form method="post" action="{% url 'logout' %}">
|
||||||
<i class="fa fa-sign-out"></i> {% trans "Log out" %}
|
{% csrf_token %}
|
||||||
</a>
|
<button class="dropdown-item" type=submit">
|
||||||
|
<i class="fa fa-sign-out"></i> {% trans "Log out" %}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
Reference in New Issue
Block a user