def post(self, request): request_body = get_request_body(request) owned_polls = Polls.get_created_polls(request_body['username']) return JsonResponse(owned_polls, safe=False, content_type="application/json")
def test_get_created_polls(self): polls = Polls.get_created_polls('test') self.assertEqual(polls[0]['title'], 'test')