Skip to content
This repository has been archived by the owner on May 15, 2020. It is now read-only.

Commit

Permalink
NEW - Added public identifier to credentials output
Browse files Browse the repository at this point in the history
  • Loading branch information
Michiel Holtkamp committed Feb 21, 2019
1 parent 57175d7 commit 76c68ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion katka/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CredentialSerializer(serializers.ModelSerializer):

class Meta:
model = Credential
fields = ('name', 'slug', 'team')
fields = ('public_identifier', 'name', 'slug', 'team')


class CredentialSecretSerializer(serializers.ModelSerializer):
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_credential_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_list(self, client, logged_in_user, team, credential):
assert response.status_code == 200
parsed = response.json()
assert len(parsed) == 1
assert UUID(parsed[0]['public_identifier']) == credential.public_identifier
assert parsed[0]['name'] == 'System user X'
parsed_team = parsed[0]['team']
assert UUID(parsed_team) == team.public_identifier
Expand All @@ -66,6 +67,7 @@ def test_get(self, client, logged_in_user, team, credential):
response = client.get(f'/credentials/{credential.public_identifier}/')
assert response.status_code == 200
parsed = response.json()
assert UUID(parsed['public_identifier']) == credential.public_identifier
assert parsed['name'] == 'System user X'
assert UUID(parsed['team']) == team.public_identifier

Expand Down

0 comments on commit 76c68ea

Please sign in to comment.