def test_delete_member(self): stat = StatusReport(user=self.test_user, status="testing") stat.save() response = StatusMember.as_view()( self.get_request(method='DELETE'), pk=stat.pk) self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) stat.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()