def test_get_source_account_store(self): migrator = OrganizationAccountStoreMappingMigrator(destination_organization=self.dst_org, source_account_store_mapping=self.src_mapping_1) migrator.destination_tenant = migrator.destination_organization.tenant account_store = migrator.source_account_store_mapping.account_store self.assertEqual(account_store.name, self.src_dir.name) self.assertEqual(account_store.description, self.src_dir.description) migrator = OrganizationAccountStoreMappingMigrator(destination_organization=self.dst_org, source_account_store_mapping=self.src_mapping_2) migrator.destination_tenant = migrator.destination_organization.tenant account_store = migrator.source_account_store_mapping.account_store self.assertEqual(account_store.name, self.src_group.name) self.assertEqual(account_store.description, self.src_group.description)
def test_migrate(self): migrator = OrganizationAccountStoreMappingMigrator(destination_organization=self.dst_org, source_account_store_mapping=self.src_mapping_1) dst_mapping = migrator.migrate() self.assertEqual(dst_mapping.organization.name, self.src_org.name) self.assertEqual(dst_mapping.organization.name_key, self.src_org.name_key) self.assertEqual(dst_mapping.organization.description, self.src_org.description) self.assertEqual(dst_mapping.account_store.name, self.src_dir.name) self.assertEqual(dst_mapping.account_store.description, self.src_dir.description) self.assertEqual(dst_mapping.list_index, self.src_mapping_1.list_index) self.assertEqual(dst_mapping.is_default_account_store, self.src_mapping_1.is_default_account_store) self.assertEqual(dst_mapping.is_default_group_store, self.src_mapping_1.is_default_group_store) migrator = OrganizationAccountStoreMappingMigrator(destination_organization=self.dst_org, source_account_store_mapping=self.src_mapping_2) dst_mapping = migrator.migrate() self.assertEqual(dst_mapping.organization.name, self.src_org.name) self.assertEqual(dst_mapping.organization.name_key, self.src_org.name_key) self.assertEqual(dst_mapping.organization.description, self.src_org.description) self.assertEqual(dst_mapping.account_store.name, self.src_group.name) self.assertEqual(dst_mapping.account_store.description, self.src_group.description) self.assertEqual(dst_mapping.list_index, self.src_mapping_2.list_index) self.assertEqual(dst_mapping.is_default_account_store, self.src_mapping_2.is_default_account_store)