def test_get_top_communities(self): """ Test retrieving top level communities """ dspace = self.dspace communities = Community.get_top_communities(dspace,expand=["parentCommunity"]) self.assertIsNotNone(communities) for com in communities: self.assertIsNone(com['parentCommunity'])
def get_top_communities(request): """ Return top level communities array """ communities = Community.get_top_communities(dspace,**dict(request.query_params)) return Response(communities,status=status.HTTP_200_OK)