def test_manager_can_delete(self): self.login() path = PathFactory() response = self.client.get(path.get_detail_url()) self.assertEqual(response.status_code, 200) response = self.client.post(path.get_delete_url()) self.assertEqual(response.status_code, 302)
def test_manager_can_delete(self): self.login() path = PathFactory() response = self.client.get(path.get_detail_url()) self.assertEqual(response.status_code, 200) response = self.client.post(path.get_delete_url()) self.assertEqual(response.status_code, 302)
def test_list_attachments_in_details(self): """Test that the list is correctly displayed on the detail page of path""" path = PathFactory(length=1) AttachmentFactory(obj=path, creator=self.user) response = self.client.get(path.get_detail_url()) self.assertTemplateUsed(response, template_name="paperclip/details.html") self.assertItemsEqual(Attachment.objects.attachments_for_object(path), response.context["attachments_list"])
def test_list_attachments_in_details(self): """Test that the list is correctly displayed on the detail page of path""" path = PathFactory(length=1) AttachmentFactory(obj=path, creator=self.user) response = self.client.get(path.get_detail_url()) self.assertTemplateUsed(response, template_name='paperclip/details.html') self.assertItemsEqual( Attachment.objects.attachments_for_object(path), response.context['attachments_list'], )