def create_empty(cls): """Create blank Issue object.""" empty_issue = IssueEntity() empty_issue.type = cls.obj_issue empty_issue.custom_attributes = {None: None} empty_issue.access_control_list = [] return empty_issue
def _create_random_issue(cls): """Create Issue entity with randomly and predictably filled fields.""" random_issue = IssueEntity() random_issue.type = cls.obj_issue random_issue.title = cls.generate_string(cls.obj_issue) random_issue.slug = cls.generate_slug() random_issue.status = unicode(element.IssueStates.DRAFT) random_issue.owners = [ObjectPersonsFactory().default().__dict__] random_issue.contact = ObjectPersonsFactory().default().__dict__ random_issue.access_control_list = [ ObjectPersonsFactory().get_acl_member( roles.ISSUE_ADMIN_ID, random_issue.owners[0]), ObjectPersonsFactory().get_acl_member( roles.ISSUE_PRIMARY_CONTACT_ID, random_issue.contact)] random_issue.os_state = unicode(element.ReviewStates.UNREVIEWED) return random_issue
def _create_random_issue(cls): """Create Issue entity with randomly and predictably filled fields.""" random_issue = IssueEntity() random_issue.type = cls.obj_issue random_issue.title = cls.generate_string(cls.obj_issue) random_issue.slug = cls.generate_slug() random_issue.status = unicode(element.IssueStates.DRAFT) random_issue.owners = [ObjectPersonsFactory().default().__dict__] random_issue.contact = ObjectPersonsFactory().default().__dict__ return random_issue