def _check_notice(request, context): if 'subject' not in request.session and 'notice' not in request.session: notice = application_notice.find_current_notice() if notice: request.session.set_expiry(3600) request.session['subject'] = notice.subject request.session['notice'] = notice.notice if 'subject' in request.session and 'notice' in request.session: context['subject'] = request.session['subject'] context['notice'] = request.session['notice']
def test_find_current_notice(self): tmp_application_notice = ApplicationNoticeFactory() db_application_notice = find_current_notice() self.assertIsNotNone(db_application_notice) self.assertEqual(db_application_notice, tmp_application_notice)
def test_find_current_notice(self): tmp_application_notice = ApplicationNoticeFactory() db_application_notice = find_current_notice() self.assertIsNotNone(db_application_notice) self.assertEqual(db_application_notice, tmp_application_notice)