Пример #1
0
 def _create_random_control(cls):
     """Create Control entity with randomly and predictably filled fields."""
     random_control = 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 = unicode(element.ObjectStates.DRAFT)
     random_control.contact = ObjectPersonsFactory().default().__dict__
     random_control.owners = [ObjectPersonsFactory().default().__dict__]
     return random_control
Пример #2
0
 def _create_random_control(cls):
     """Create Control entity with randomly and predictably filled fields."""
     random_control = 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 = unicode(element.ObjectStates.DRAFT)
     random_control.contact = cls.default_person.__dict__
     random_control.owners = [cls.default_person.__dict__]
     random_control.access_control_list = [
         ObjectPersonsFactory().get_acl_member(roles.ADMIN_ID,
                                               random_control.owners[0]),
         ObjectPersonsFactory().get_acl_member(roles.PRIMARY_CONTACT_ID,
                                               random_control.contact)
     ]
     return random_control
Пример #3
0
 def _create_random_control(cls):
   """Create Control entity with randomly and predictably filled fields."""
   random_control = 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 = unicode(element.ObjectStates.DRAFT)
   random_control.contact = cls.default_person.__dict__
   random_control.owners = [cls.default_person.__dict__]
   random_control.access_control_list = [
       ObjectPersonsFactory().get_acl_member(
           roles.CONTROL_ADMIN_ID, random_control.owners[0]),
       ObjectPersonsFactory().get_acl_member(
           roles.CONTROL_PRIMARY_CONTACT_ID, random_control.contact)]
   random_control.os_state = unicode(element.ReviewStates.UNREVIEWED)
   return random_control