Skip to content

Commit

Permalink
Merge pull request #35315 from dimagi/nh/no_list
Browse files Browse the repository at this point in the history
CommCareAnalyticsUserResource doesn't support list
  • Loading branch information
kaapstorm authored Nov 1, 2024
2 parents 136859d + 2532ac2 commit 97072ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions corehq/apps/api/resources/v0_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,7 @@ class CommCareAnalyticsUserResource(CouchResourceMixin, HqBaseResource, DomainSp

class Meta(CustomResourceMeta):
resource_name = 'analytics-roles'
list_allowed_methods = []
detail_allowed_methods = ['get']

def dehydrate(self, bundle):
Expand Down
6 changes: 4 additions & 2 deletions corehq/apps/api/tests/test_user_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,12 +733,14 @@ class TestCommCareAnalyticsUserResource(APIResourceTest):
api_name = 'v0.5'

def test_flag_not_enabled(self):
response = self._assert_auth_get_resource(self.list_endpoint)
endpoint = self.single_endpoint(self.username)
response = self._assert_auth_get_resource(endpoint)
self.assertEqual(response.status_code, 404)

@flag_enabled('SUPERSET_ANALYTICS')
def test_user_roles_returned(self):
response = self._assert_auth_get_resource(self.list_endpoint)
endpoint = self.single_endpoint(self.username)
response = self._assert_auth_get_resource(endpoint)
expected_response_obj = {
'permissions': {'can_edit': True, 'can_view': True},
'resource_uri': '',
Expand Down

0 comments on commit 97072ef

Please sign in to comment.