File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,7 +100,26 @@ class EditRequestCase(TestCase):
100100 pass
101101
102102class NotMeetingCase (TestCase ):
103- pass
103+
104+ def test_not_meeting (self ):
105+
106+ make_test_data ()
107+ group = Group .objects .get (acronym = 'mars' )
108+ url = reverse ('sessions_no_session' ,kwargs = {'acronym' :group .acronym })
109+ self .client .login (username = "secretary" , password = "secretary+password" )
110+
111+ r = self .client .get (url ,follow = True )
112+ # If the view invoked by that get throws an exception (such as an integrity error),
113+ # the traceback from this test will talk about a TransactionManagementError and
114+ # yell about executing queries before the end of an 'atomic' block
115+
116+ # This is a sign of a problem - a get shouldn't have a side-effect like this one does
117+ self .assertEqual (r .status_code , 200 )
118+ self .assertTrue ('A message was sent to notify not having a session' in r .content )
119+
120+ r = self .client .get (url ,follow = True )
121+ self .assertEqual (r .status_code , 200 )
122+ self .assertTrue ('is already marked as not meeting' in r .content )
104123
105124class RetrievePreviousCase (TestCase ):
106125 pass
Original file line number Diff line number Diff line change @@ -622,7 +622,9 @@ def no_session(request, acronym):
622622 requested = datetime .datetime .now (),
623623 requested_by = login ,
624624 requested_duration = 0 ,
625- status = SessionStatusName .objects .get (slug = 'notmeet' ))
625+ status = SessionStatusName .objects .get (slug = 'notmeet' ),
626+ type_id = 'session' ,
627+ )
626628 session_save (session )
627629
628630 # send notification
You can’t perform that action at this time.
0 commit comments