def test_data_endpoint_inventory_admin(self):
     """Translation of input args to lookup args, space in type"""
     kwargs = {'user': 2, 'type': 'Inventory Admin', 'inventory': 5}
     data, endpoint = Role.data_endpoint(kwargs, ignore=['res'])
     self.assertIn('members__in', data)
     self.assertEqual(endpoint, '/roles/')
     self.assertIn('role_field', data)
     self.assertEqual(data['role_field'], 'inventory_admin_role')
Пример #2
0
 def test_data_endpoint_inventory_ignore(self):
     """Translation of input args to lookup args, ignoring inventory"""
     kwargs = {'user': 2, 'type': 'admin', 'inventory': 5}
     data, endpoint = Role.data_endpoint(kwargs, ignore=['res'])
     self.assertIn('members__in', data)
     self.assertEqual(endpoint, '/roles/')
Пример #3
0
 def test_data_endpoint_team_no_res(self):
     """Translation of input args to lookup args, using team"""
     kwargs = {'team': 2}
     data, endpoint = Role.data_endpoint(kwargs, ignore=[])
     self.assertEqual(endpoint, 'teams/2/roles/')
     self.assertNotIn('object_id', data)
 def test_data_endpoint_team_no_res(self):
     """Translation of input args to lookup args, using team"""
     kwargs = {'team': 2}
     data, endpoint = Role.data_endpoint(kwargs, ignore=[])
     self.assertEqual(endpoint, 'teams/2/roles/')
     self.assertNotIn('object_id', data)
 def test_data_endpoint_inventory_ignore(self):
     """Translation of input args to lookup args, ignoring inventory"""
     kwargs = {'user': 2, 'type': 'admin', 'inventory': 5}
     data, endpoint = Role.data_endpoint(kwargs, ignore=['res'])
     self.assertIn('members__in', data)
     self.assertEqual(endpoint, '/roles/')