@@ -474,3 +474,82 @@ def test_with_structured_published_orga_files(self) -> None:
474474 assert status_code == 200
475475 # Should not include mediafile ids bc presenter does not include orga mediafiles
476476 assert data ["mediafile" ] == {}
477+
478+ def base_test_export_with_timestamps_old_db_compatibility (
479+ self , old_db_compatibility : bool
480+ ) -> None :
481+ meeting_timestamp_unix = 626637600
482+ meeting_timestamp_string = "1989-11-09T18:00:00+00:00"
483+ motion_timestamp_unix = 1033479479
484+ motion_timestamp_string = "2002-10-01T13:37:59.687459+00:00"
485+ self .set_models (
486+ {
487+ "meeting/1" : {
488+ "start_time" : datetime .fromtimestamp (
489+ meeting_timestamp_unix , tz = ZoneInfo ("Europe/Berlin" )
490+ )
491+ }
492+ }
493+ )
494+ self .create_motion (
495+ 1 ,
496+ 1 ,
497+ motion_data = {
498+ "created" : datetime .fromtimestamp (
499+ 1033479479.687459 , tz = ZoneInfo ("Europe/Berlin" )
500+ )
501+ },
502+ )
503+ old_db_compatibility_data = (
504+ {"old_db_compatibility" : True } if old_db_compatibility else {}
505+ )
506+ status_code , data = self .request (
507+ "export_meeting" ,
508+ {"meeting_id" : 1 , ** old_db_compatibility_data },
509+ )
510+ assert status_code == 200
511+ if old_db_compatibility :
512+ assert data ["meeting" ]["1" ]["start_time" ] == meeting_timestamp_unix
513+ assert data ["motion" ]["1" ]["created" ] == motion_timestamp_unix
514+ else :
515+ assert data ["meeting" ]["1" ]["start_time" ] == meeting_timestamp_string
516+ assert data ["motion" ]["1" ]["created" ] == motion_timestamp_string
517+
518+ def test_export_with_timestamps_old_db_compatibility_true (self ) -> None :
519+ self .base_test_export_with_timestamps_old_db_compatibility (True )
520+
521+ def test_export_with_timestamps_old_db_compatibility_false (self ) -> None :
522+ self .base_test_export_with_timestamps_old_db_compatibility (False )
523+
524+ def base_test_export_without_mmiagi_old_db_compatibility (
525+ self , old_db_compatibility : bool
526+ ) -> None :
527+ self .create_mediafile (1 , 1 )
528+ self .set_models (
529+ {
530+ "meeting_mediafile/1" : {
531+ "is_public" : False ,
532+ "meeting_id" : 1 ,
533+ "mediafile_id" : 1 ,
534+ },
535+ }
536+ )
537+ old_db_compatibility_data = (
538+ {"old_db_compatibility" : True } if old_db_compatibility else {}
539+ )
540+ status_code , data = self .request (
541+ "export_meeting" ,
542+ {"meeting_id" : 1 , ** old_db_compatibility_data },
543+ )
544+ assert status_code == 200
545+ if old_db_compatibility :
546+ assert data ["meeting_mediafile" ]["1" ]["inherited_access_group_ids" ] == []
547+ else :
548+ assert "inherited_access_group_ids" not in data ["meeting_mediafile" ]["1" ]
549+ assert "access_group_ids" not in data ["meeting_mediafile" ]["1" ]
550+
551+ def test_export_without_mmiagi_old_db_compatibility_true (self ) -> None :
552+ self .base_test_export_without_mmiagi_old_db_compatibility (True )
553+
554+ def test_export_without_mmiagi_old_db_compatibility_false (self ) -> None :
555+ self .base_test_export_without_mmiagi_old_db_compatibility (False )
0 commit comments