1414import  sqlalchemy  as  sa 
1515from  aiohttp .test_utils  import  TestClient 
1616from  aioresponses  import  aioresponses 
17+ from  deepdiff  import  DeepDiff 
1718from  faker  import  Faker 
1819from  models_library .api_schemas_directorv2 .dynamic_services  import  (
1920    GetProjectInactivityResponse ,
@@ -168,13 +169,9 @@ async def _assert_get_same_project(
168169        project_permalink  =  data .pop ("permalink" , None )
169170        folder_id  =  data .pop ("folderId" , None )
170171
171-         got_last_change_date  =  data .pop ("lastChangeDate" , None )
172-         project_last_change_date  =  project .pop ("lastChangeDate" , None )
173-         if  got_last_change_date  is  not   None  and  project_last_change_date  is  not   None :
174-             assert  to_datetime (got_last_change_date ) >=  to_datetime (
175-                 project_last_change_date 
176-             )
177-         assert  data  ==  {k : project [k ] for  k  in  data }
172+         assert  not  DeepDiff (
173+             data , {k : project [k ] for  k  in  data }, exclude_paths = "root['lastChangeDate']" 
174+         )
178175
179176        if  project_state :
180177            assert  ProjectStateOutputSchema .model_validate (project_state )
@@ -213,17 +210,11 @@ async def test_list_projects(
213210        project_permalink  =  got .pop ("permalink" )
214211        folder_id  =  got .pop ("folderId" )
215212
216-         got_last_change_date  =  got .pop ("lastChangeDate" , None )
217-         template_project_last_change_date  =  template_project .pop ("lastChangeDate" , None )
218-         if  (
219-             got_last_change_date  is  not   None 
220-             and  template_project_last_change_date  is  not   None 
221-         ):
222-             assert  to_datetime (got_last_change_date ) >=  to_datetime (
223-                 template_project_last_change_date 
224-             )
225- 
226-         assert  got  ==  {k : template_project [k ] for  k  in  got }
213+         assert  not  DeepDiff (
214+             got ,
215+             {k : template_project [k ] for  k  in  got },
216+             exclude_paths = "root['lastChangeDate']" ,
217+         )
227218
228219        assert  not  ProjectStateOutputSchema (
229220            ** project_state 
@@ -236,17 +227,11 @@ async def test_list_projects(
236227        project_permalink  =  got .pop ("permalink" , None )
237228        folder_id  =  got .pop ("folderId" )
238229
239-         got_last_change_date  =  got .pop ("lastChangeDate" , None )
240-         user_project_last_change_date  =  user_project .pop ("lastChangeDate" , None )
241-         if  (
242-             got_last_change_date  is  not   None 
243-             and  user_project_last_change_date  is  not   None 
244-         ):
245-             assert  to_datetime (got_last_change_date ) >=  to_datetime (
246-                 user_project_last_change_date 
247-             )
248- 
249-         assert  got  ==  {k : user_project [k ] for  k  in  got }
230+         assert  not  DeepDiff (
231+             got ,
232+             {k : user_project [k ] for  k  in  got },
233+             exclude_paths = "root['lastChangeDate']" ,
234+         )
250235
251236        assert  ProjectStateOutputSchema (** project_state )
252237        assert  project_permalink  is  None 
@@ -263,17 +248,12 @@ async def test_list_projects(
263248        project_permalink  =  got .pop ("permalink" , None )
264249        folder_id  =  got .pop ("folderId" )
265250
266-         got_last_change_date  =  got .pop ("lastChangeDate" , None )
267-         user_project_last_change_date  =  user_project .pop ("lastChangeDate" , None )
268-         if  (
269-             got_last_change_date  is  not   None 
270-             and  user_project_last_change_date  is  not   None 
271-         ):
272-             assert  to_datetime (got_last_change_date ) >=  to_datetime (
273-                 user_project_last_change_date 
274-             )
251+         assert  not  DeepDiff (
252+             got ,
253+             {k : user_project [k ] for  k  in  got },
254+             exclude_paths = "root['lastChangeDate']" ,
255+         )
275256
276-         assert  got  ==  {k : user_project [k ] for  k  in  got }
277257        assert  not  ProjectStateOutputSchema (
278258            ** project_state 
279259        ).share_state .locked , "Single user does not lock" 
@@ -291,17 +271,11 @@ async def test_list_projects(
291271        project_permalink  =  got .pop ("permalink" )
292272        folder_id  =  got .pop ("folderId" )
293273
294-         got_last_change_date  =  got .pop ("lastChangeDate" , None )
295-         template_project_last_change_date  =  template_project .pop ("lastChangeDate" , None )
296-         if  (
297-             got_last_change_date  is  not   None 
298-             and  template_project_last_change_date  is  not   None 
299-         ):
300-             assert  to_datetime (got_last_change_date ) >=  to_datetime (
301-                 template_project_last_change_date 
302-             )
303- 
304-         assert  got  ==  {k : template_project [k ] for  k  in  got }
274+         assert  not  DeepDiff (
275+             got ,
276+             {k : template_project [k ] for  k  in  got },
277+             exclude_paths = "root['lastChangeDate']" ,
278+         )
305279        assert  not  ProjectStateOutputSchema (
306280            ** project_state 
307281        ).share_state .locked , "Templates are not locked" 
0 commit comments