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_new_msg(self): """webmessage - count the nb of new message""" 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) self.assertEqual(get_nb_new_messages_for_user(5), 1)