def test_get_all_communities(self): """ Test Retrieving all communities """ dspace= self.dspace communities = Community.get_all(dspace) self.assertGreater(len(communities),0)
def test_get_all_communities_with_limit(self): """ Test Retrieving all communities with limit """ dspace= self.dspace max_communities = 5 communities = Community.get_all(dspace,limit=[max_communities]) self.assertLessEqual(len(communities),max_communities)
def get(self,request,*args,**kwargs): communities = Community.get_all(dspace,**dict(self.request.query_params)) return Response(communities, status=status.HTTP_200_OK)