Ejemplo n.º 1
0
 def _create_random_control(cls):
     """Create Control entity with randomly and predictably filled fields."""
     random_control = entity.ControlEntity()
     random_control.type = cls.obj_control
     random_control.title = cls.generate_string(cls.obj_control)
     random_control.slug = cls.generate_slug()
     random_control.status = element.ObjectStates.DRAFT
     random_control.contact = ObjectOwnersFactory().default().__dict__
     random_control.owners = [ObjectOwnersFactory().default().__dict__]
     return random_control
Ejemplo n.º 2
0
 def _create_random_control(cls):
     """Create Control entity with randomly and predictably filled fields."""
     random_control = entity.ControlEntity()
     random_control.title = cls.generate_title(cls.obj_control)
     random_control.type = cls.obj_control
     random_control.code = cls.generate_code()
     random_control.owner = roles.DEFAULT_USER
     random_control.primary_contact = roles.DEFAULT_USER
     random_control.state = element.ObjectStates.DRAFT
     return random_control
Ejemplo n.º 3
0
 def create_empty(cls):
     """Create blank Control object."""
     empty_control = entity.ControlEntity()
     empty_control.type = cls.obj_control
     return empty_control