Skip to content

Commit

Permalink
Fix linting errors and failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
rajpatel24 committed Dec 2, 2024
1 parent 9e3355a commit aa796c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 4 additions & 0 deletions kpi/tests/api/v1/test_api_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def test_asset_list_matches_detail(self):
self.assertIsNotNone(list_result_detail)
self.assertDictEqual(expected_list_data, dict(list_result_detail))

@unittest.skip(reason='`owner_label` field only exists in v2 endpoint')
def test_asset_owner_label(self):
pass


class AssetVersionApiTests(test_api_assets.AssetVersionApiTests):
URL_NAMESPACE = None
Expand Down
13 changes: 6 additions & 7 deletions kpi/tests/api/v2/test_api_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ def test_asset_owner_label(self):
"""
Test the behavior of the owner_label field in the Asset API.
- If the user is an organization owner and the organization is a multi-member
organization (MMO), then the `owner_label` should be the organization's name.
- If the user is not an organization owner and the organization is a multi-member
organization (MMO), then the `owner_label` should be the owner's username.
- If the user is an organization owner but the organization is not a multi-member
organization (MMO), then the `owner_label` should be the owner's username.
- If the user is an organization owner and the organization is MMO,
then the `owner_label` should be the organization's name.
- If the user is not an organization owner and the organization is MMO,
then the `owner_label` should be the owner's username.
- If the user is an organization owner but the organization is not MMO,
then the `owner_label` should be the owner's username.
"""
detail_response = self.create_asset()
asset_owner_username = detail_response.data.get('owner__username')
Expand Down Expand Up @@ -150,7 +150,6 @@ def test_asset_owner_label(self):
asset_owner_username,
)


def test_assets_hash(self):
another_user = User.objects.get(username='anotheruser')
user_asset = Asset.objects.get(pk=1)
Expand Down

0 comments on commit aa796c9

Please sign in to comment.