Skip to content

Commit

Permalink
!fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
gagantrivedi committed Aug 21, 2024
1 parent cc037cf commit 8d4a1b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion api/features/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,6 @@ def get_update_log_message(self, history_instance) -> typing.Optional[str]:

# NOTE: We have some feature state values that were created before we started
# tracking history, resulting in no prev_record.

changes = (
history_instance.diff_against(history_instance.prev_record).changes
if history_instance.prev_record
Expand Down
12 changes: 8 additions & 4 deletions api/tests/unit/features/test_unit_features_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,15 +697,19 @@ def test_feature_state_value_get_skip_create_audit_log_if_environment_feature_ve
assert feature_state.feature_state_value.get_skip_create_audit_log() is True


def test_feature_state_value_get_skip_create_audit_log_for_deleted_feature_state(
feature: Feature,
def test_feature_state_value__get_skip_create_audit_log_for_deleted_feature_state(
feature: Feature, feature_segment, environment
):
# Give
feature_state = feature.feature_states.first()
feature_state = FeatureState.objects.create(
feature=feature, feature_segment=feature_segment, environment=environment
)
feature_state_value = feature_state.feature_state_value

# When
feature_state.delete()
# Delete feature segment to cascade delete feature state
# instead of soft delete
feature_segment.delete()

# Then
fsv_history_instance = FeatureStateValue.history.filter(
Expand Down
2 changes: 1 addition & 1 deletion api/tests/unit/features/test_unit_features_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,7 @@ def test_update_feature_state_without_history_of_fsv(
response = admin_client_new.put(
url, data=json.dumps(data), content_type="application/json"
)

# Then
assert response.status_code == status.HTTP_200_OK


Expand Down

0 comments on commit 8d4a1b8

Please sign in to comment.