def test_read(self):
    self.login(self.admin)
    response = self.url_get('unicef', reverse('profiles.user_read', args=[self.admin.pk]))
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.context['edit_button_url'], reverse('profiles.user_self'))
    response = self.url_get('unicef', reverse('profiles.user_read', args=[self.user1.pk]))
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.context['edit_button_url'], reverse('profiles.user_update', args=[self.user1.pk]))
    response = self.url_get('unicef', reverse('profiles.user_read', args=[self.user3.pk]))
    self.assertEqual(response.status_code, 404)
    self.login(self.user1)
    response = self.url_get('unicef', reverse('profiles.user_read', args=[self.admin.pk]))
    self.assertEqual(response.status_code, 200)
    self.assertIsNone(response.context['edit_button_url'])
def test_read(self):
    self.login(self.admin)
    response = self.url_get('unicef', reverse('profiles.user_read', args=[self.admin.pk]))
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.context['edit_button_url'], reverse('profiles.user_self'))
    response = self.url_get('unicef', reverse('profiles.user_read', args=[self.user1.pk]))
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.context['edit_button_url'], reverse('profiles.user_update', args=[self.user1.pk]))
    response = self.url_get('unicef', reverse('profiles.user_read', args=[self.user3.pk]))
    self.assertEqual(response.status_code, 404)
    self.login(self.user1)
    response = self.url_get('unicef', reverse('profiles.user_read', args=[self.admin.pk]))
    self.assertEqual(response.status_code, 200)
    self.assertIsNone(response.context['edit_button_url'])