def test_delete_member(self): statu=StatusReport( user=self.test_user, status="testing") statu.save() response =StatusMember.as_view()(self.get_request(method="DELETE"),pk=statu.pk) self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) statu.delete()
def test_delete_member(self): stat = StatusReport(user=self.test_user, status="testing") stat.save() response = StatusMember.as_view()(self.get_request('DELETE'), pk=stat.pk) self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) stat.delete()
def test_get_member(self): statu=StatusReport( user=self.test_user, status="testing") statu.save() status=StatusReport.objects.get(pk=statu.id) expected_json=StatusReportSerializer(status).data response =StatusMember.as_view()(self.get_request(),pk=statu.id) self.assertEqual(expected_json,response.data) statu.delete()
def test_get_member(self): stat = StatusReport(user=self.test_user, status="testing") stat.save() status = StatusReport.objects.get(pk=stat.id) expected_json = StatusReportSerializer(status).data response = StatusMember.as_view()(self.get_request(), pk=stat.id) self.assertEqual(expected_json, response.data) stat.delete()