def test_options(self): with self.login(email=self.basic_user().email): response = self.client.options(self.url) assert response.status_code == 200 results = response.data["actions"]["GET"]["properties"]["results"] get_options = results["item"]["properties"] assert_fields(JUDGING_ROUND_GET_FIELDS, get_options)
def test_options(self): program = ProgramFactory() with self.login(email=self.basic_user().email): url = reverse(ProgramDetailView.view_name, args=[program.id]) response = self.client.options(url) assert response.status_code == 200 get_options = response.data["actions"]["GET"]["properties"] assert_fields(PROGRAM_GET_FIELDS, get_options)
def test_options(self): industry = IndustryFactory() with self.login(email=self.basic_user().email): url = reverse(IndustryDetailView.view_name, args=[industry.id]) response = self.client.options(url) assert response.status_code == 200 get_options = response.data["actions"]["GET"]["properties"] assert_fields(MPTT_FIELDS.keys(), get_options)
def test_options(self): program_family = JudgingRoundFactory().program.program_family email = self.global_operations_manager(program_family).email url = reverse(CloneCriteriaView.view_name) with self.login(email=email): response = self.client.options(url) results = response.data["actions"]["GET"]["properties"]["results"] get_options = results["item"]["properties"] assert_fields(CloneCriteriaView.fields().keys(), get_options)
def test_options(self): user = UserFactory() with self.login(email=self.basic_user().email): url = reverse(UserHistoryView.view_name, args=[user.id]) response = self.client.options(url) assert response.status_code == 200 results = response.data["actions"]["GET"]["properties"]["results"] get_options = results["item"]["properties"] assert_fields(UserHistoryView.fields().keys(), get_options)
def test_options(self): code = RefundCodeFactory() with self.login(email=self.basic_user().email): url = reverse(CreditCodeDetailView.view_name, args=[code.pk]) response = self.client.options(url) assert response.status_code == 200 get_options = response.data["actions"]["GET"]["properties"] assert_fields(CREDIT_CODE_GET_FIELDS, get_options)
def test_options(self): application = ApplicationFactory() with self.login(email=self.basic_user().email): url = reverse(ApplicationDetailView.view_name, args=[application.id]) response = self.client.options(url) assert response.status_code == 200 get_options = response.data["actions"]["GET"]["properties"] assert_fields(APPLICATION_GET_FIELDS, get_options)
def test_options(self): judging_round = JudgingRoundFactory() with self.login(email=self.basic_user().email): url = reverse(JudgingRoundDetailView.view_name, args=[judging_round.id]) response = self.client.options(url) assert response.status_code == 200 get_options = response.data["actions"]["GET"]["properties"] assert_fields(JUDGING_ROUND_GET_FIELDS, get_options)
def test_startup_options(self): organization = StartupFactory().organization with self.login(email=self.basic_user().email): url = reverse(OrganizationDetailView.view_name, args=[organization.id]) response = self.client.options(url) assert response.status_code == 200 get_options = response.data["actions"]["GET"]["properties"] assert_fields(STARTUP_GET_FIELDS, get_options)
def test_options(self): stm = StartupTeamMemberFactory(startup_administrator=True) with self.login(email=self.basic_user().email): url = reverse(UserOrganizationsView.view_name, args=[stm.user.id]) response = self.client.options(url) assert response.status_code == 200 get_options = response.data["actions"]["GET"]["properties"] assert_fields(USER_ORGANIZATIONS_GET_FIELDS, get_options) assert (ORGANIZATION_USER_FIELDS.keys() == get_options["organizations"]["item"]["properties"].keys())
def test_options_judging_round_criteria_header(self): context = AnalyzeJudgingContext() judging_round_id = context.judging_round.id with self.login(email=self.basic_user().email): url = reverse(self.view_name, args=[judging_round_id]) response = self.client.options(url) results = response.data["actions"]["GET"]["properties"]["results"] get_options = results["item"]["properties"] assert_fields(JudgingRoundCriteriaHeaderView.fields().keys(), get_options)
def test_expert_options(self): context = UserContext(user_type=EXPERT_USER_TYPE) user = context.user with self.login(email=self.basic_user().email): url = reverse(UserDetailView.view_name, args=[user.id]) response = self.client.options(url) get_options = response.data["actions"]["GET"]["properties"] assert_fields(EXPERT_GET_FIELDS, get_options) assert_fields_missing(EXPERT_WRITE_ONLY_FIELDS, get_options) patch_options = response.data["actions"]["PATCH"]["properties"] assert_fields(EXPERT_ONLY_MUTABLE_FIELDS, patch_options)
def test_options(self): user = ExpertFactory(profile__expert_group=TEST_EXPERT_GROUP, profile__internal_notes=TEST_INTERNAL_NOTES) with self.login(email=self.privileged_user().email): url = reverse(UserConfidentialView.view_name, args=[user.id]) response = self.client.options(url) assert response.status_code == 200 get_data = response.data["actions"]["GET"] assert get_data["type"] == "object" get_options = get_data["properties"] assert_fields(UserConfidentialView.fields().keys(), get_options)
def test_options(self): with self.login(email=self.basic_user().email): response = self.client.options(self.url) assert response.status_code == 200 results = response.data["actions"]["GET"]["properties"]["results"] get_options = results["item"]["properties"] assert_fields(ENTREPRENEUR_GET_FIELDS, get_options) assert_fields(EXPERT_GET_FIELDS, get_options) post_options = response.data["actions"]["POST"]["properties"] assert_fields_required(REQUIRED_POST_FIELDS, post_options) assert_fields_not_required(ALL_POST_FIELDS - REQUIRED_POST_FIELDS, post_options)
def test_options(self): option = CriterionOptionSpecContext().criterion_option_spec judging_round = option.criterion.judging_round program_family = judging_round.program.program_family email = self.global_operations_manager(program_family).email with self.login(email=email): url = reverse(AnalyzeJudgingRoundView.view_name, args=[judging_round.id]) response = self.client.options(url) assert response.status_code == 200 results = response.data["actions"]["GET"]["properties"]["results"] get_options = results["item"]["properties"] assert_fields(AnalyzeJudgingRoundView.fields().keys(), get_options)
def test_options(self): context = UserContext() user = context.user with self.login(email=self.basic_user().email): url = reverse(UserDetailView.view_name, args=[user.id]) response = self.client.options(url) assert response.status_code == 200 get_data = response.data["actions"]["GET"] assert get_data["type"] == "object" get_options = get_data["properties"] assert_fields(ENTREPRENEUR_GET_FIELDS, get_options) assert_fields_missing(EXPERT_GET_FIELDS, get_options) patch_options = response.data["actions"]["PATCH"]["properties"] assert_fields_required(["id"], patch_options) assert_fields_not_required(ENTREPRENEUR_PATCH_FIELDS, patch_options) assert_fields_missing(NON_PATCH_FIELDS, patch_options) assert_fields_missing(EXPERT_ONLY_MUTABLE_FIELDS, patch_options) assert_fields_missing(EXPERT_WRITE_ONLY_FIELDS, patch_options) assert_fields_missing(["POST"], response.data["actions"])