Commit 9298448a by Kálmán Viktor

dashboard: fix tests

parent e6764922
......@@ -47,7 +47,7 @@
</ul>
</li>
</ul>
{% if user.is_authenticated %}
{% if user.is_authenticated and user.pk %}
<a class="navbar-brand pull-right" href="{% url "logout" %}?next={% url "login" %}" style="color: white; font-size: 10px;"><i class="icon-signout icon-sign-out"></i> {% trans "Log out" %}</a>
<a class="navbar-brand pull-right" href="{% url "dashboard.views.profile" pk=user.pk %}" title="{% trans "User profile" %}" style="color: white; font-size: 10px;"><i class="icon-user "></i> {{user}}</a>
{% if user.is_superuser %}
......
{% load i18n %}
{% if user.get_full_name %}
{% if user and user.pk %}
{% if user.get_full_name %}
{{ user.get_full_name }}
{% else %}
{% else %}
{{ user.username }}
{% endif %}
{% endif %}
{% if show_org %}
{% if show_org %}
{% if user.profile and user.profile.org_id %}
({{ user.profile.org_id }})
{% else %}
({% trans "username" %}: {{ user.username }})
{% endif %}
{% endif %}
{% endif %}
......@@ -49,6 +49,7 @@ class ViewUserTestCase(unittest.TestCase):
with patch.object(InstanceActivityDetail, 'get_object') as go:
act = MagicMock(spec=InstanceActivity)
act._meta.object_name = "InstanceActivity"
act.user.pk = 1
go.return_value = act
view = InstanceActivityDetail.as_view()
self.assertEquals(view(request, pk=1234).render().status_code, 200)
......
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 sign in to comment