def show_tag(name): links = Link.get_public_by_tag(name) title = 'Links for Tag - "%s"' % name return render_template('link_index.html', pageoptions=get_default_data(), user=None, curr_user=current_user, links=links, section_title=title, page_title=title)
def show_all_user_tagged(name, username): user = User.get_by_username(username) links = Link.get_public_by_tag(name, user.userid) title = 'Links for tag "%s" by %s' % (name, user.username) return render_template('link_index.html', pageoptions=get_default_data(), user=user, curr_user=current_user, links=links, section_title=title, page_title=title)
def test_get_public_by_tag_nonexistent_hasuser(self): result = Link.get_public_by_tag('this does not exist', 1) self.assertEqual(len(result), 0)
def test_get_public_by_tag_exists_hasuser(self): result = Link.get_public_by_tag('test1', 1) self.assertEqual(len(result), 2)