Fix stars link in header

This commit is contained in:
Yohan Boniface 2023-06-17 15:59:16 +02:00
parent 44d3e64d56
commit b324e59cd4
2 changed files with 8 additions and 1 deletions

View file

@ -8,7 +8,7 @@
<ul>
{% if user.is_authenticated %}
<li><a href="{{ user.get_url }}">{% trans "My maps" %} ({{ user }})</a></li>
<li><a href="{{ user.get_stars_url %}">{% trans "Starred maps" %}</a></li>
<li><a href="{{ user.get_stars_url }}">{% trans "Starred maps" %}</a></li>
{% else %}
<li><a href="{% url 'login' %}" class="login">{% trans "Log in" %} / {% trans "Sign in" %}</a></li>
{% endif %}

View file

@ -569,6 +569,13 @@ def test_user_can_see_their_star(client, map, user):
assert map.name in response.content.decode()
def test_stars_link(client, map, user):
client.login(username=user.username, password="123123")
response = client.get(reverse("home"))
assert response.status_code == 200
assert "/user/Joe/stars" in response.content.decode()
@pytest.mark.usefixtures("allow_anonymous")
def test_cannot_send_link_on_owned_map(client, map):
assert len(mail.outbox) == 0