

def test_user_can_see_cloud_he_has_access_to_within_customer(self):
    for user_role in ('admin', 'manager', 'group_manager'):
        self.client.force_authenticate(user=self.users[user_role])
        seen_cloud = self.clouds[user_role]
        response = self.client.get(self._get_customer_url(self.customer))
        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertIn('clouds', response.data, 'Customer must contain cloud list')
        cloud_urls = set([cloud['url'] for cloud in response.data['clouds']])
        self.assertIn(self._get_cloud_url(seen_cloud), cloud_urls, 'User should see cloud')

dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/iaas/tests/test_customer_addendum.py CustomerAddendumApiPermissionTest.test_user_can_see_cloud_he_has_access_to_within_customer/original