コード例 #1
0
    def post(self, request):
        request_body = get_request_body(request)
        involved_polls = Polls.get_involved_polls(request_body['username'])

        return JsonResponse(involved_polls,
                            safe=False,
                            content_type="application/json")
コード例 #2
0
 def test_get_involved_polls(self):
     polls = Polls.get_involved_polls('test')
     self.assertEqual(polls[0]['event_poll__title'], 'test')