def execute(self, principal_mapping, mode):
     migrator = OGDSMigrator(self.portal,
                             principal_mapping,
                             mode=mode,
                             strict=True)
     results = migrator.migrate()
     return results
    def test_inbox_group_gets_migrated(self):
        org_unit_id = self.org_unit.unit_id
        migrator = OGDSMigrator(self.portal, {"client1_inbox_users": "new_inbox_group"}, "move")
        migrator.migrate()

        org_unit = ogds_service().fetch_org_unit(org_unit_id)
        self.assertEquals("new_inbox_group", org_unit.inbox_group.groupid)
    def test_returns_proper_results_for_moving_inbox_group(self):
        migrator = OGDSMigrator(self.portal, {"client1_inbox_users": "new_inbox_group"}, "move")
        results = migrator.migrate()

        self.assertEquals(
            [("<OrgUnit client1>", "client1_inbox_users", "new_inbox_group")], results["inbox_groups"]["moved"]
        )
Beispiel #4
0
    def test_returns_proper_results_for_moving_users_group(self):
        migrator = OGDSMigrator(self.portal,
                                {'client1_users': 'new_users_group'}, 'move')
        results = migrator.migrate()

        self.assertEquals(
            [('<OrgUnit client1>', 'client1_users', 'new_users_group')],
            results['users_groups']['moved'])
Beispiel #5
0
    def test_users_group_gets_migrated(self):
        org_unit_id = self.org_unit.unit_id
        migrator = OGDSMigrator(self.portal,
                                {'client1_users': 'new_users_group'}, 'move')
        migrator.migrate()

        org_unit = ogds_service().fetch_org_unit(org_unit_id)
        self.assertEquals('new_users_group', org_unit.users_group.groupid)
    def test_inbox_group_gets_migrated(self):
        org_unit_id = self.org_unit.unit_id
        migrator = OGDSMigrator(
            self.portal, {'org-unit-1_inbox_users': 'new_inbox_group'}, 'move')
        migrator.migrate()

        org_unit = ogds_service().fetch_org_unit(org_unit_id)
        self.assertEquals('new_inbox_group', org_unit.inbox_group.groupid)
Beispiel #7
0
    def test_returns_proper_results_for_moving_inbox_group(self):
        migrator = OGDSMigrator(
            self.portal, {'org-unit-1_inbox_users': 'new_inbox_group'}, 'move')
        results = migrator.migrate()

        self.assertEquals(
            [('<OrgUnit org-unit-1>', 'org-unit-1_inbox_users', 'new_inbox_group')],
            results['inbox_groups']['moved']
        )
Beispiel #8
0
 def execute(self, principal_mapping, mode):
     migrator = OGDSMigrator(self.portal, principal_mapping,
                             mode=mode, strict=True)
     results = migrator.migrate()
     return results
    def test_raises_if_group_doesnt_exist(self):
        migrator = OGDSMigrator(self.portal, {"client1_users": "doesnt.exist"}, "move")

        with self.assertRaises(UserMigrationException):
            migrator.migrate()
Beispiel #10
0
    def test_raises_if_group_doesnt_exist(self):
        migrator = OGDSMigrator(self.portal, {'client1_users': 'doesnt.exist'},
                                'move')

        with self.assertRaises(UserMigrationException):
            migrator.migrate()
    def test_raises_if_group_doesnt_exist(self):
        migrator = OGDSMigrator(
            self.portal, {'org-unit-1_users': 'doesnt.exist'}, 'move')

        with self.assertRaises(UserMigrationException):
            migrator.migrate()