1818from ietf .group .models import Group , GroupEvent
1919from ietf .meeting .models import Meeting , Room , TimeSlot , SchedTimeSessAssignment , Session
2020from ietf .meeting .test_data import make_meeting_test_data
21+ from ietf .name .models import SessionStatusName
2122from ietf .person .models import Person
2223from ietf .secr .meetings .forms import get_times
2324from ietf .utils .mail import outbox
@@ -148,16 +149,21 @@ def test_blue_sheets_generate(self):
148149 def test_notifications (self ):
149150 "Test Notifications"
150151 meeting = make_meeting_test_data ()
152+ mars_group = Group .objects .get (acronym = 'mars' )
153+ ames_group = Group .objects .get (acronym = 'ames' )
154+ ames_stsa = meeting .agenda .assignments .get (session__group = ames_group )
155+ assert ames_stsa .session .status_id == 'schedw'
156+ mars_stsa = meeting .agenda .assignments .get (session__group = mars_group )
157+ mars_stsa .session .status = SessionStatusName .objects .get (slug = 'appr' )
158+ mars_stsa .session .save ()
151159 url = reverse ('ietf.secr.meetings.views.notifications' ,kwargs = {'meeting_id' :72 })
152160 self .client .login (username = "secretary" , password = "secretary+password" )
153161 response = self .client .get (url )
154162 self .assertEqual (response .status_code , 200 )
155163 q = PyQuery (response .content )
156164 self .assertEqual (q ('#id_notification_list' ).html (),'ames, mars' )
157-
165+
158166 # test that only changes since last notification show up
159- mars_group = Group .objects .get (acronym = 'mars' )
160- ames_group = Group .objects .get (acronym = 'ames' )
161167 now = datetime .datetime .now ()
162168 then = datetime .datetime .now ()+ datetime .timedelta (hours = 1 )
163169 person = Person .objects .get (name = "(System)" )
@@ -172,13 +178,17 @@ def test_notifications(self):
172178 q = PyQuery (response .content )
173179 self .assertEqual (q ('#id_notification_list' ).html (),'ames' )
174180
175- # test that email goes out
181+ # test post: email goes out, status changed
176182 mailbox_before = len (outbox )
177183 self .client .login (username = "secretary" , password = "secretary+password" )
178184 response = self .client .post (url )
179185 self .assertEqual (response .status_code , 302 )
180186 self .assertEqual (len (outbox ), mailbox_before + 1 )
181-
187+ ames_stsa = meeting .agenda .assignments .get (session__group = ames_group )
188+ assert ames_stsa .session .status_id == 'sched'
189+ mars_stsa = meeting .agenda .assignments .get (session__group = mars_group )
190+ assert mars_stsa .session .status_id == 'sched'
191+
182192 def test_meetings_rooms (self ):
183193 meeting = make_meeting_test_data ()
184194 url = reverse ('ietf.secr.meetings.views.rooms' ,kwargs = {'meeting_id' :72 ,'schedule_name' :'test-agenda' })
0 commit comments