1818from core .signing import sign_payload
1919from environments .models import Environment , Webhook
2020from features .models import Feature
21+ from features .multivariate .models import (
22+ MultivariateFeatureOption ,
23+ MultivariateFeatureStateValue ,
24+ )
2125from organisations .models import OrganisationWebhook
2226from projects .models import ( # type: ignore[attr-defined]
2327 Organisation ,
@@ -328,6 +332,19 @@ def generate_environment_sample_webhook_data() -> dict[str, Any]:
328332 ),
329333 )
330334
335+ mv_option = MultivariateFeatureOption (
336+ id = 1 ,
337+ feature = feature ,
338+ default_percentage_allocation = 50 ,
339+ type = "unicode" ,
340+ string_value = "variant_a" ,
341+ )
342+ mv_state_value = MultivariateFeatureStateValue (
343+ id = 1 ,
344+ multivariate_feature_option = mv_option ,
345+ percentage_allocation = 50 ,
346+ )
347+
331348 data = {
332349 "changed_by" : "user@domain.com" ,
333350 "timestamp" : "2021-06-18T07:50:26.595298Z" ,
@@ -338,6 +355,7 @@ def generate_environment_sample_webhook_data() -> dict[str, Any]:
338355 value = "feature_state_value" ,
339356 identity_id = 1 ,
340357 identity_identifier = "test_identity" ,
358+ multivariate_feature_state_values = [mv_state_value ],
341359 ),
342360 "previous_state" : Webhook .generate_webhook_feature_state_data (
343361 feature = feature ,
@@ -346,6 +364,7 @@ def generate_environment_sample_webhook_data() -> dict[str, Any]:
346364 value = "old_feature_state_value" ,
347365 identity_id = 1 ,
348366 identity_identifier = "test_identity" ,
367+ multivariate_feature_state_values = [mv_state_value ],
349368 ),
350369 }
351370
0 commit comments