def METHOD_NAME(self, project, other_group):
    config = f"""
        projects_and_groups:
          {project.path_with_namespace}:
            members:
              groups:
                {other_group.full_path}:
                  group_access: {AccessLevel.MAINTAINER.value}
            protected_environments:
              enforce: true
              foo:
                deploy_access_levels:
                  - group: {other_group.id}
        """
    run_gitlabform(config, project)
    protected_envs_under_this_project = project.protected_environments.list()
    assert len(protected_envs_under_this_project) == 1
    assert protected_envs_under_this_project[0].name == "foo"
    assert len(protected_envs_under_this_project[0].deploy_access_levels) == 1
    assert (
        protected_envs_under_this_project[0].deploy_access_levels[0]["group_id"]
        == other_group.id
    )