@@ -10,9 +10,9 @@ class TestGeonodeGroupsHandler(unittest.TestCase):
1010 def test_list (self , mock_http_get ):
1111 """Ensure list calls the groups endpoint and returns groups list."""
1212 mock_http_get .return_value = {
13- "groups " : [
14- {"pk" : 1 , "title" : "Group A" , "name " : "group-a" , "description" : "" },
15- {"pk" : 2 , "title" : "Group B" , "name " : "group-b" , "description" : "" },
13+ "group_profiles " : [
14+ {"pk" : 1 , "title" : "Group A" , "slug " : "group-a" , "description" : "" },
15+ {"pk" : 2 , "title" : "Group B" , "slug " : "group-b" , "description" : "" },
1616 ]
1717 }
1818 handler = GeonodeGroupsHandler (env = {})
@@ -23,9 +23,14 @@ def test_list(self, mock_http_get):
2323
2424 @patch .object (GeonodeGroupsHandler , "http_get" )
2525 def test_get (self , mock_http_get ):
26- """Ensure get returns the 'group ' dict from the API response."""
26+ """Ensure get returns the 'group_profile ' dict from the API response."""
2727 mock_http_get .return_value = {
28- "group" : {"pk" : 1 , "title" : "Group A" , "name" : "group-a" , "description" : "" }
28+ "group_profile" : {
29+ "pk" : 1 ,
30+ "title" : "Group A" ,
31+ "slug" : "group-a" ,
32+ "description" : "" ,
33+ }
2934 }
3035 handler = GeonodeGroupsHandler (env = {})
3136 result = handler .get (1 )
@@ -62,7 +67,7 @@ def test_create_with_title(self, mock_http_post):
6267 )
6368 mock_http_post .assert_called_once_with (
6469 endpoint = "groups" ,
65- json = {"title" : "New Group" , "description " : "A desc " , "name " : "new-group " },
70+ json = {"title" : "New Group" , "slug " : "new-group " , "description " : "A desc " },
6671 )
6772 self .assertEqual (result ["pk" ], 5 )
6873
0 commit comments