rename availability policies
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f4894d3a8c
commit
52dbe93d3c
3 changed files with 6 additions and 4 deletions
|
@ -196,6 +196,8 @@ def main():
|
|||
reset()
|
||||
elif args.cmd == 'testdata':
|
||||
testdata()
|
||||
elif args.cmd == 'migrate':
|
||||
print('not implemented yet')
|
||||
else:
|
||||
print('Unknown command: {}'.format(args.cmd))
|
||||
exit(1)
|
||||
|
|
|
@ -5,7 +5,7 @@ from rest_framework.response import Response
|
|||
|
||||
from hostadmin.models import Domain
|
||||
from authentication.signature_auth import SignatureAuthentication
|
||||
from toolshed.models import Tag, Property, Category
|
||||
from toolshed.models import Tag, Property, Category, InventoryItem
|
||||
from toolshed.serializers import CategorySerializer, PropertySerializer
|
||||
from backend.settings import TOOLSHED_VERSION
|
||||
|
||||
|
@ -51,8 +51,7 @@ def list_categories(request, format=None): # /categories/
|
|||
@permission_classes([IsAuthenticated])
|
||||
@authentication_classes([SignatureAuthentication])
|
||||
def list_availability_policies(request, format=None): # /availability_policies/
|
||||
policies = ['private', 'friends', 'internal', 'public']
|
||||
return Response(policies)
|
||||
return Response(InventoryItem.AVAILABILITY_POLICY_CHOICES)
|
||||
|
||||
|
||||
@api_view(['GET'])
|
||||
|
|
|
@ -43,7 +43,8 @@ class CombinedApiTestCase(UserTestMixin, CategoryTestMixin, TagTestMixin, Proper
|
|||
def test_policy_api(self):
|
||||
response = client.get('/api/availability_policies/', self.f['local_user1'])
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.json(), ['private', 'friends', 'internal', 'public'])
|
||||
self.assertEqual(response.json(), [['sell', 'Sell'], ['rent', 'Rent'], ['lend', 'Lend'], ['share', 'Share'],
|
||||
['private', 'Private']])
|
||||
|
||||
def test_combined_api_anonymous(self):
|
||||
response = anonymous_client.get('/api/info/')
|
||||
|
|
Loading…
Reference in a new issue