def test_misconfigured_credentials(self): tmp_setting = settings.ORCHESTRA_PROJECT_API_CREDENTIALS del settings.ORCHESTRA_PROJECT_API_CREDENTIALS with self.assertRaises(AuthenticationFailed): self.authentication.fetch_user_data('a') settings.ORCHESTRA_PROJECT_API_CREDENTIALS = tmp_setting self.assertEqual(self.authentication.fetch_user_data('a'), (SignedUser(), 'b'))
def setUp(self): super().setUp() self.request_client = APIClient(enforce_csrf_checks=True) self.request_client.force_authenticate(user=SignedUser()) self.workflow_version = WorkflowVersionFactory() self.step = StepFactory(slug='step-slug', workflow_version=self.workflow_version) self.project = ProjectFactory(workflow_version=self.workflow_version)
def setUp(self): super().setUp() self.request_client = APIClient(enforce_csrf_checks=True) self.request_client.force_authenticate(user=SignedUser()) setup_models(self) self.workflow_version = WorkflowVersionFactory() self.step = StepFactory(slug='step-slug', workflow_version=self.workflow_version) self.project = ProjectFactory(workflow_version=self.workflow_version) self.list_url = reverse('orchestra:api:todo-api-list') self.todo = TodoFactory(project=self.project) self.todo_with_step = TodoFactory(project=self.project, step=self.step)
def setUp(self): super().setUp() self.request_client = APIClient(enforce_csrf_checks=True) self.request_client.force_authenticate(user=SignedUser()) self.todolist_template_slug = 'test_todolist_template_slug' self.todolist_template_name = 'test_todolist_template_name' self.todolist_template_description = \ 'test_todolist_template_description' self.workflow_version = WorkflowVersionFactory() self.step = StepFactory(slug='step-slug', workflow_version=self.workflow_version) self.project = ProjectFactory(workflow_version=self.workflow_version)
def test_auth_success(self): self.assertEqual(self.authentication.fetch_user_data('a'), (SignedUser(), 'b'))
def setUp(self): super().setUp() setup_models(self) self.api_client = APIClient(enforce_csrf_checks=True) self.api_client.force_authenticate(user=SignedUser())
def setUp(self): # noqa super(ProjectAPITestCase, self).setUp() setup_models(self) self.api_client = APIClient(enforce_csrf_checks=True) self.api_client.force_authenticate(user=SignedUser())