ContactΒΆ

The contact app does not include a detail view, because you will almost certainly want to write your own. Here is some code to get you started:

url(regex=r'^contact/(?P<slug>[-\w\d]+)/$',
    view=ContactDetailView.as_view(),
    name='contact.detail'
    ),

In views.py:

from contact.views import ContactDetailMixin

class ContactDetailView(
        LoginRequiredMixin, ContactDetailMixin, BaseMixin, DetailView):
    pass

In test_view_perm.py:

# -*- encoding: utf-8 -*-
import pytest

from django.core.urlresolvers import reverse

from contact.tests.factories import UserContactFactory
from login.tests.fixture import perm_check
from login.tests.scenario import get_user_web

@pytest.mark.django_db
def test_contact_detail(perm_check):
    UserContactFactory(user=get_user_web())
    user_contact = UserContactFactory()
    url = reverse('contact.detail', args=[user_contact.contact.user.username])
    perm_check.staff(url)