Commit 9298448a by Kálmán Viktor

dashboard: fix tests

parent e6764922
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</ul> </ul>
</li> </li>
</ul> </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 "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> <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 %} {% if user.is_superuser %}
......
{% load i18n %} {% load i18n %}
{% if user.get_full_name %} {% if user and user.pk %}
{{ user.get_full_name }} {% if user.get_full_name %}
{% else %} {{ user.get_full_name }}
{{ user.username }}
{% endif %}
{% if show_org %}
{% if user.profile and user.profile.org_id %}
({{ user.profile.org_id }})
{% else %} {% else %}
({% trans "username" %}: {{ user.username }}) {{ user.username }}
{% endif %}
{% if show_org %}
{% if user.profile and user.profile.org_id %}
({{ user.profile.org_id }})
{% else %}
({% trans "username" %}: {{ user.username }})
{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
...@@ -49,6 +49,7 @@ class ViewUserTestCase(unittest.TestCase): ...@@ -49,6 +49,7 @@ class ViewUserTestCase(unittest.TestCase):
with patch.object(InstanceActivityDetail, 'get_object') as go: with patch.object(InstanceActivityDetail, 'get_object') as go:
act = MagicMock(spec=InstanceActivity) act = MagicMock(spec=InstanceActivity)
act._meta.object_name = "InstanceActivity" act._meta.object_name = "InstanceActivity"
act.user.pk = 1
go.return_value = act go.return_value = act
view = InstanceActivityDetail.as_view() view = InstanceActivityDetail.as_view()
self.assertEquals(view(request, pk=1234).render().status_code, 200) 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