'Test that only the owner of the certificate can access the url'

def test_permissions(self):

    resp = self.client.get(self.get_url(self.student.username))
    self.assertEqual(resp.status_code, status.HTTP_401_UNAUTHORIZED)
    self.client.login(username=self.student_no_cert.username, password=USER_PASSWORD)
    resp = self.client.get(self.get_url(self.student.username))
    self.assertEqual(resp.status_code, status.HTTP_404_NOT_FOUND)
    self.assertEqual(resp.data, {u'detail': u'Not    found.'})
    self.client.logout()
    self.client.login(username=self.student.username, password=USER_PASSWORD)
    resp = self.client.get(self.get_url(self.student.username))
    self.assertEqual(resp.status_code, status.HTTP_200_OK)
    self.client.logout()
    self.client.login(username=self.staff_user.username, password=USER_PASSWORD)
    resp = self.client.get(self.get_url(self.student.username))
    self.assertEqual(resp.status_code, status.HTTP_200_OK)
