def account_new_mail(uid, ln=CFG_SITE_LANG): """ display new mail info for myaccount.py page. @param uid: user id (int) @param ln: language @return: html body """ nb_new_mail = db.get_nb_new_messages_for_user(uid) total_mail = db.get_nb_readable_messages_for_user(uid) return webmessage_templates.tmpl_account_new_mail(nb_new_mail, total_mail, ln)
def test_getting_nb_readable_messages(self): """webmessage - get the nb of readable messages""" delete_all_messages(5) # juliet writes the message to romeo webmessage.perform_request_send(6, msg_to_user="******", msg_to_group="", msg_subject="Hi romeo", msg_body="hello romeo how are you?", ln=CFG_SITE_LANG) msgid = get_all_messages_for_user(5)[0][0] # status is changed set_message_status(5, msgid, 'R') self.assertEqual(get_nb_readable_messages_for_user(5), 1) webmessage.perform_request_delete_msg(5, msgid, ln=CFG_SITE_LANG)