Commit f55ac1a6 authored by Claude Paroz's avatar Claude Paroz

Restore the user link at top of page

Fixes bug #754847.
parent 568ecd0f
......@@ -38,6 +38,7 @@ class CommonTest(TestCase):
self.pn = Person(first_name='John', last_name='Note',
email='jn@devnull.com', username= 'jn', activation_key='a_activation_key')
self.pn.save()
self.pn.set_password('password')
self.pr = Person(first_name='John', last_name='Reviewer',
username='jr', date_joined=datetime.now()-timedelta(days=11),
......
......@@ -58,6 +58,15 @@ class PeopleTestCase(TestCase):
self.assertContains(response, "GNOME is being developed by following people:")
self.assertContains(response, "John Nothing")
def test_login_link(self):
self.pn = self._create_person()
self.client.login(username='jn', password='password')
response = self.client.get(reverse('home'))
self.assertContains(
response,
'<a href="%s">' % (reverse('person_detail_username', args=[self.pn.username]),)
)
def test_edit_details(self):
self.pn = self._create_person()
self.client.login(username='jn', password='password')
......
......@@ -39,7 +39,7 @@
{% if user.is_authenticated %}
<form action="{% url 'login' %}" method="post">
{% csrf_token %}
<a href="{{ user.get_absolute_url }}"><img src="{{ STATIC_URL }}img/nobody-16.png" alt="Person">&nbsp;{{ user.person }}</a> &bull;
<a href="{% url 'person_detail_username' user.username %}"><img src="{{ STATIC_URL }}img/nobody-16.png" alt="Person">&nbsp;{{ user.person }}</a> &bull;
<input type="hidden" name="logout" value="1">
<input type="submit" value="{% trans 'Log out' %}">
</form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment