def test_photo_detail(self):
    response = self.client.get('/ptests/photo/test-photo/')
    self.assertEqual(response.context['object'], self.photo1)
    response = self.client.get('/ptests/photo/not-on-site-photo/')
    self.assertEqual(response.status_code, 404)
def test_photo_detail(self):
    response = self.client.get('/ptests/photo/test-photo/')
    self.assertEqual(response.context['object'], self.photo1)
    response = self.client.get('/ptests/photo/not-on-site-photo/')
    self.assertEqual(response.status_code, 404)