def render(self, kind, cur_p=''): if cur_p == '': current_page_number = 1 else: current_page_number = int(cur_p) current_page_number = 1 if current_page_number < 1 else current_page_number kwd = {'current_page': current_page_number} # Todo ( 已经改好 ) recs = MEntity.get_by_kind(kind=kind, current_page_num=current_page_number) return self.render_string('modules/post/entity_list.html', kwd=kwd, rec=recs)
def test_get_by_kind(self): MEntity.get_by_kind('2') assert True