1818from app_analytics .models import FeatureEvaluationRaw
1919from environments .identities .models import Identity
2020from environments .models import Environment
21+ from api .integrations .launch_darkly .types import Project
2122from features .models import Feature
2223from organisations .models import (
2324 Organisation ,
2425 OrganisationSubscriptionInformationCache ,
2526)
2627from tests .types import EnableFeaturesFixture
2728
29+ @pytest .fixture ()
30+ def feature_with_dots (project : Project ) -> Feature :
31+ return Feature .objects .create (name = "feature.with.dots" , project = project ) # type: ignore[no-any-return]
2832
2933def test_sdk_analytics_ignores_bad_data (
3034 mocker : MockerFixture ,
@@ -61,13 +65,13 @@ def test_sdk_analytics_ignores_bad_data(
6165def test_sdk_analytics_ignores_feature_data_with_dots (
6266 mocker : MockerFixture ,
6367 environment : Environment ,
64- feauture_with_dots : Feature ,
68+ feature_with_dots : Feature ,
6569 api_client : APIClient ,
6670) -> None :
6771 # Given
6872 api_client .credentials (HTTP_X_ENVIRONMENT_KEY = environment .api_key )
6973
70- data = { feauture_with_dots .name : 20 }
74+ data = { feature_with_dots .name : 20 }
7175 mocked_feature_eval_cache = mocker .patch (
7276 "app_analytics.views.feature_evaluation_cache"
7377 )
@@ -85,8 +89,8 @@ def test_sdk_analytics_ignores_feature_data_with_dots(
8589
8690 mocked_feature_eval_cache .track_feature_evaluation .assert_called_once_with (
8791 environment_id = environment .id ,
88- feature_name = feauture_with_dots .name ,
89- evaluation_count = data [feauture_with_dots .name ],
92+ feature_name = feature_with_dots .name ,
93+ evaluation_count = data [feature_with_dots .name ],
9094 labels = {},
9195 )
9296
0 commit comments