def _create_random_program(cls): """Create Program entity with randomly and predictably filled fields.""" random_program = entity.ProgramEntity() random_program.type = cls.obj_program random_program.title = cls.generate_string(cls.obj_program) random_program.slug = cls.generate_slug() random_program.status = element.ObjectStates.DRAFT random_program.manager = ObjectOwnersFactory().default().__dict__ random_program.contact = ObjectOwnersFactory().default().__dict__ return random_program
def _create_random_program(cls): """Create Program entity with randomly and predictably filled fields.""" random_program = entity.ProgramEntity() random_program.title = cls.generate_title(cls.obj_program) random_program.type = cls.obj_program random_program.code = cls.generate_code() random_program.manager = roles.DEFAULT_USER random_program.primary_contact = roles.DEFAULT_USER random_program.state = element.ObjectStates.DRAFT return random_program
def create_empty(cls): """Create blank Program object.""" empty_program = entity.ProgramEntity() empty_program.type = cls.obj_program return empty_program