@@ -779,6 +779,7 @@ def test_send_daily_newsletter(es_org_app):
779779
780780 session = org_app .session ()
781781 org_app .org .enable_automatic_newsletters = True
782+ org_app .org .show_news_as_tiles = False
782783 org_app .org .newsletter_times = '10' , '11' , '16'
783784
784785 news = PageCollection (session )
@@ -805,11 +806,15 @@ def test_send_daily_newsletter(es_org_app):
805806 with freeze_time (datetime (2018 , 3 , 5 , 10 , 0 , tzinfo = tz )):
806807 # Created today at 10:00, published immediately
807808 news .add (
808- parent = news_parent , title = 'News3' , type = 'news' , access = 'public' )
809+ parent = news_parent , title = 'News3' , type = 'news' , access = 'public' ,
810+ lead = 'Lead of News 3' ,
811+ )
809812 # Created today at 10:00, published today 10:01
810813 news .add (
811814 parent = news_parent , title = 'News4' , type = 'news' , access = 'public' ,
812- publication_start = utcnow () + timedelta (minutes = 1 ))
815+ publication_start = utcnow () + timedelta (minutes = 1 ),
816+ lead = 'Lead of News 4' ,
817+ )
813818
814819 transaction .commit ()
815820
@@ -823,10 +828,13 @@ def test_send_daily_newsletter(es_org_app):
823828 assert newsletter .title == 'Täglicher Newsletter 05.03.2018, 10:00'
824829 assert len (os .listdir (client .app .maildir )) == 1
825830 mail = client .get_email (0 )
826- assert "News1" in mail ['TextBody' ]
827- assert "News2" in mail ['TextBody' ]
828- assert "News3" not in mail ['TextBody' ]
829- assert "News4" not in mail ['TextBody' ]
831+ assert 'News1' in mail ['TextBody' ]
832+ assert 'News2' in mail ['TextBody' ]
833+ assert 'News3' not in mail ['TextBody' ]
834+ assert 'News4' not in mail ['TextBody' ]
835+
836+ org_app .org .show_news_as_tiles = True
837+ transaction .commit ()
830838
831839 with freeze_time (datetime (2018 , 3 , 5 , 11 , 0 , tzinfo = tz )):
832840 client .get (get_cronjob_url (job ))
@@ -836,10 +844,12 @@ def test_send_daily_newsletter(es_org_app):
836844 assert 'Täglicher Newsletter 05.03.2018, 11:00' in newsletter .title
837845 assert len (os .listdir (client .app .maildir )) == 2
838846 mail = client .get_email (1 )
839- assert "News1" not in mail ['TextBody' ]
840- assert "News2" not in mail ['TextBody' ]
841- assert "News3" in mail ['TextBody' ]
842- assert "News4" in mail ['TextBody' ]
847+ assert 'News1' not in mail ['TextBody' ]
848+ assert 'News2' not in mail ['TextBody' ]
849+ assert 'News3' in mail ['TextBody' ]
850+ assert 'Lead of News 3' in mail ['TextBody' ]
851+ assert 'News4' in mail ['TextBody' ]
852+ assert 'Lead of News 4' in mail ['TextBody' ]
843853
844854 with freeze_time (datetime (2018 , 3 , 5 , 16 , 0 , tzinfo = tz )):
845855 client .get (get_cronjob_url (job ))
0 commit comments