def test_remote_config_override(
    environment: Environment,
    project: Project,
) -> None:
    """specific test for bug raised following work to make feature segments unique to an environment"""
    # Given - an identity with a trait that has a value of 10
    identity = Identity.objects.create(identifier="test", environment=environment)
    trait = Trait.objects.create(
        identity=identity,
        trait_key="my_trait",
        integer_value=10,
        value_type=INTEGER,
    )

    # and a segment that matches users that have a value for this trait greater than 5
    segment = Segment.objects.create(name="Test segment", project=project)
    segment_rule = SegmentRule.objects.create(
        segment=segment, type=SegmentRule.ALL_RULE
    )
    Condition.objects.create(
        rule=segment_rule,
        operator=GREATER_THAN,
        value="5",
        property=trait.trait_key,
    )

    # and a feature that has a segment override in the same environment as the identity
    remote_config = Feature.objects.create(
        name="my_feature", initial_value="initial value", project=project
    )
    overridden_value_1 = "overridden value 1"
    feature_segment = FeatureSegment.objects.create(
        feature=remote_config, environment=environment, segment=segment
    )
    segment_feature_state = FeatureState.objects.create(
        feature=remote_config,
        feature_segment=feature_segment,
        environment=environment,
    )
    FeatureStateValue.objects.filter(feature_state=segment_feature_state).update(
        string_value=overridden_value_1, type=STRING
    )

    # When - the value of the feature state attached to the feature segment is
    # updated and we get all the feature states for the identity
    overridden_value_2 = "overridden value 2"
    segment_feature_state.feature_state_value.string_value = overridden_value_2
    segment_feature_state.feature_state_value.save()
    feature_states = identity.get_all_feature_states()

    # Then - the feature state value is correctly set to the newly updated feature segment value
    assert len(feature_states) == 1

    overridden_feature_state = feature_states[0]
    assert overridden_feature_state.get_feature_state_value() == overridden_value_2
specific test for bug raised following work to make feature segments unique to an environment
api/tests/unit/environments/identities/test_unit_identities_models.py