Lines 62-67
from ucsschool.lib.roles import (
|
Link Here
|
---|
|
62 |
from ucsschool.lib.models import School, User, Student, Teacher, TeachersAndStaff, Staff, SchoolClass, WorkGroup |
62 |
from ucsschool.lib.models import School, User, Student, Teacher, TeachersAndStaff, Staff, SchoolClass, WorkGroup |
63 |
from ucsschool.lib.models.utils import add_stream_logger_to_schoollib, get_stream_handler, UniStreamHandler |
63 |
from ucsschool.lib.models.utils import add_stream_logger_to_schoollib, get_stream_handler, UniStreamHandler |
64 |
from ucsschool.lib.models.group import ComputerRoom |
64 |
from ucsschool.lib.models.group import ComputerRoom |
|
|
65 |
from ucsschool.lib.models.computer import SchoolComputer |
65 |
try: |
66 |
try: |
66 |
from typing import Dict, List, Optional, Tuple |
67 |
from typing import Dict, List, Optional, Tuple |
67 |
except ImportError: |
68 |
except ImportError: |
Lines 789-800
class UCSTestSchool(object):
|
Link Here
|
---|
|
789 |
'name': '%s-%s' % (ou_name, name), |
790 |
'name': '%s-%s' % (ou_name, name), |
790 |
'description': description, |
791 |
'description': description, |
791 |
'hosts': host_members, |
792 |
'hosts': host_members, |
792 |
'teacher_computers': teacher_computers |
|
|
793 |
} |
793 |
} |
794 |
logger.info('*** Creating new room %r', name) |
794 |
logger.info('*** Creating new room %r with settings %r', name, kwargs) |
795 |
obj = ComputerRoom(**kwargs) |
795 |
obj = ComputerRoom(**kwargs) |
796 |
result = obj.create(self.lo) |
796 |
result = obj.create(self.lo) |
797 |
logger.info('*** Result of ComputerRoom(...).create(): %r', result) |
797 |
logger.info('*** Result of ComputerRoom(...).create(): %r', result) |
|
|
798 |
logger.info('*** Setting up teacher computers: {}'.format(teacher_computers)) |
799 |
for teacher_pc in teacher_computers: |
800 |
pc = SchoolComputer.from_dn(teacher_pc, ou_name, self.lo) |
801 |
pc.teacher_computer = True |
802 |
pc.modify(self.lo) |
803 |
logger.info('*** Teacher computer set up') |
798 |
if wait_for_replication: |
804 |
if wait_for_replication: |
799 |
utils.wait_for_replication() |
805 |
utils.wait_for_replication() |
800 |
utils.verify_ldap_object(obj.dn, expected_attr={'ucsschoolRole': [create_ucsschool_role_string(role_computer_room, ou_name)]}, strict=False, should_exist=True) |
806 |
utils.verify_ldap_object(obj.dn, expected_attr={'ucsschoolRole': [create_ucsschool_role_string(role_computer_room, ou_name)]}, strict=False, should_exist=True) |