use check permissions in /media endpoint
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
90d1149c07
commit
e819700bb0
7 changed files with 56 additions and 13 deletions
|
|
@ -64,8 +64,7 @@ def combined_info(request, format=None): # /info/
|
|||
categories = [str(category) for category in Category.objects.all()]
|
||||
policies = ['private', 'friends', 'internal', 'public']
|
||||
domains = [domain.name for domain in Domain.objects.filter(open_registration=True)]
|
||||
return Response(
|
||||
{'tags': tags, 'properties': properties, 'policies': policies, 'categories': categories, 'domains': domains})
|
||||
return Response({'tags': tags, 'properties': properties, 'availability_policies': policies, 'categories': categories, 'domains': domains})
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
|
|
|
|||
|
|
@ -52,10 +52,9 @@ class CombinedApiTestCase(UserTestMixin, CategoryTestMixin, TagTestMixin, Proper
|
|||
def test_combined_api(self):
|
||||
response = client.get('/api/info/', self.f['local_user1'])
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.json()['policies'], ['private', 'friends', 'internal', 'public'])
|
||||
self.assertEqual(response.json()['availability_policies'], ['private', 'friends', 'internal', 'public'])
|
||||
self.assertEqual(response.json()['categories'],
|
||||
['cat1', 'cat2', 'cat3', 'cat1/subcat1', 'cat1/subcat2', 'cat1/subcat1/subcat3'])
|
||||
self.assertEqual(response.json()['tags'], ['tag1', 'tag2', 'tag3'])
|
||||
self.assertEqual([p['name'] for p in response.json()['properties']], ['prop1', 'prop2', 'prop3'])
|
||||
self.assertEqual(response.json()['domains'], ['example.com'])
|
||||
self.assertEqual(response.json()['policies'], ['private', 'friends', 'internal', 'public'])
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from authentication.tests import SignatureAuthClient, UserTestMixin, ToolshedTestCase
|
||||
from files.tests import FilesTestMixin
|
||||
from toolshed.models import InventoryItem, Category
|
||||
from toolshed.tests import InventoryTestMixin, CategoryTestMixin, TagTestMixin, PropertyTestMixin
|
||||
from toolshed.tests import InventoryTestMixin
|
||||
|
||||
client = SignatureAuthClient()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue