3131 get_stats ,
3232 get_warnings ,
3333)
34+ from general .userdata import BasicUserData , Sex , load_user_data
3435from tracking .metrics import Metric
3536from tracking .values import ScaleValue , ValuesManager
3637from tracking .valuestorsage import ValuesStorage , open_storage
@@ -84,6 +85,13 @@ def setUp(self) -> None:
8485 Path (self .temp_dir .name ) / "test.sqlite" ,
8586 )
8687 self .db_patch .start ()
88+ test_userdata = BasicUserData (
89+ datetime (2004 , 8 , 28 , 0 , 0 ),
90+ Sex .MALE ,
91+ 178
92+ )
93+ self .user_data_patch = patch ("analysis.stats.load_user_data" , return_value = test_userdata )
94+ self .user_data_patch .start ()
8795 self .now_patch = patch ("analysis.stats.datetime" )
8896 dt_mock = self .now_patch .start ()
8997 dt_mock .now .return_value = datetime (2026 , 8 , 31 , 0 , 0 )
@@ -96,6 +104,7 @@ def setUp(self) -> None:
96104 def tearDown (self ) -> None :
97105 self .db_patch .stop ()
98106 self .now_patch .stop ()
107+ self .user_data_patch .stop ()
99108 self .temp_dir .cleanup ()
100109
101110 def test_get_values_series (self ):
@@ -225,6 +234,14 @@ def setUp(self) -> None:
225234 )
226235 self .db_patch .start ()
227236
237+ test_userdata = BasicUserData (
238+ datetime (2004 , 8 , 28 , 0 , 0 ),
239+ Sex .MALE ,
240+ 178
241+ )
242+ self .user_data_patch = patch ("analysis.stats.load_user_data" , return_value = test_userdata )
243+ self .user_data_patch .start ()
244+
228245 self .now_patch = patch ("analysis.stats.datetime" )
229246 dt_mock = self .now_patch .start ()
230247 dt_mock .now .return_value = datetime (2026 , 8 , 31 , 0 , 0 )
@@ -267,6 +284,7 @@ def tearDown(self) -> None:
267284 self .db_patch .stop ()
268285 self .now_patch .stop ()
269286 self .manager_patch .stop ()
287+ self .user_data_patch .stop ()
270288 self .temp_dir .cleanup ()
271289
272290 def test_no_warning_on_normal (self ):
0 commit comments