def METHOD_NAME(
    mocker, project
):
    # Given
    mocked_project_metadata = mocker.patch(
        "environments.dynamodb.migrator.DynamoProjectMetadata"
    )
    mocked_send_migration_event = mocker.patch(
        "environments.dynamodb.migrator.send_migration_event", autospec=True
    )
    mocked_project_metadata_instance = mocker.MagicMock(
        spec=DynamoProjectMetadata, id=project.id
    )
    mocked_project_metadata.get_or_new.return_value = mocked_project_metadata_instance
    identity_migrator = IdentityMigrator(project.id)
    # When
    identity_migrator.trigger_migration()
    # Then
    mocked_project_metadata.get_or_new.assert_called_with(project.id)
    mocked_project_metadata_instance.trigger_identity_migration.assert_called_once_with()
    mocked_send_migration_event.assert_called_once_with(project.id)