コード例 #1
0
ファイル: tests.py プロジェクト: f14c0/conectate-dspace
 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'])
コード例 #2
0
ファイル: views.py プロジェクト: f14c0/conectate-dspace
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)