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")
def test_get_involved_polls(self): polls = Polls.get_involved_polls('test') self.assertEqual(polls[0]['event_poll__title'], 'test')