def test_create_new_person_w_no_role(self, selenium): """Check newly created person is on Admin People widget""" expected_person = entities_factory.PeopleFactory().create( system_wide_role=roles.NO_ROLE) actual_person = admin_webui_service.PeopleAdminWebUiService( selenium).create_new_person(expected_person) self.general_equal_assert(expected_person, actual_person)
def test_edit_authorizations(self, creator, selenium): """Check that person role can be edited.""" exp_person = creator.people_tree_item_representation() exp_person.system_wide_role = roles.ADMINISTRATOR act_person = admin_webui_service.PeopleAdminWebUiService( selenium).edit_authorizations(creator, roles.ADMINISTRATOR) self.general_equal_assert(exp_person, act_person)
def test_edit_person(self, person_tree_item_data, creator, selenium): """Check that person can be edited.""" creator.name = element.Common.EDITED_PART + creator.name creator.email = element.Common.EDITED_PART + creator.email creator.company = element.Common.EDITED_PART ppl_admin_service = admin_webui_service.PeopleAdminWebUiService(selenium) ppl_admin_service.edit_person(person_tree_item_data, creator) act_person = ppl_admin_service.expand_found_person(creator).get_person() self.general_equal_assert(creator.people_tree_item_representation(), act_person)
def ppl_data(self, selenium): """Create person and return test data.""" if not self.__class__.data: expected_person = entities_factory.PeopleFactory().create( system_wide_role=roles.NO_ROLE) ppl_admin_service = admin_webui_service.PeopleAdminWebUiService( selenium) self.__class__.data = { "exp_person": expected_person, "exp_ppl_count": ppl_admin_service.ppl_count + 1, "act_person": ppl_admin_service.create_new_person(expected_person), "act_ppl_count": ppl_admin_service.ppl_count } return self.__class__.data
def person_tree_item_data(self, creator, selenium): """Create new person and return actual person data from people tree view item.""" return admin_webui_service.PeopleAdminWebUiService( selenium).expand_found_person(creator).get_person()