def setUpTestData(cls): # noqa super().setUpTestData() cls.internal_client = InternalClient(service=cls.INTERNAL_SERVICE) if cls.ADMIN_USER: user = UserFactory(is_staff=True, is_superuser=True) cls.auth_client = AuthorizedClient(user=user) else: cls.auth_client = AuthorizedClient()
def setUp(self): super().setUp() self.normal_client = AuthorizedClient() self.url = self.get_url() self.objects = [self.factory_class() # pylint:disable=not-callable for _ in range(self.num_objects)] self.queryset = self.model_class.objects.filter()
def setUp(self): super().setUp() self.normal_client = AuthorizedClient() self.object = self.factory_class() self.url = '/{}/catalogs/registry_access/{}/'.format( API_V1, self.object.name) self.queryset = self.model_class.objects.all()
def test_non_owner(self): new_client = AuthorizedClient() assert new_client.get(self.url + '?keys=value1').status_code in ( status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN) assert new_client.post(self.url, data={ node_selectors.NODE_SELECTORS_BUILD_JOBS: { 'foo': 'bar' } }).status_code in (status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN)
def setUp(self): super().setUp() self.normal_client = AuthorizedClient() self.object = self.factory_class() # pylint:disable=not-callable self.url = self.get_url() self.queryset = self.model_class.objects.all()
def setUp(self): super().setUp() self.normal_client = AuthorizedClient() self.url = '/{}/catalogs/registry_access/'.format(API_V1) self.objects = [self.factory_class() for _ in range(self.num_objects)] self.queryset = self.model_class.objects.filter()
def setUp(self): super().setUp() self.normal_client = AuthorizedClient() self.object = self.factory_class() self.url = self.get_access_url(self.object.name) self.queryset = self.model_class.objects.all()