def test_lookups(self): """ Test bookmark, category, and location lookups. """ with app.test_request_context('/'): self.assertIsInstance( get_bookmark_lookup().bookmark('apples'), Bookmark) self.assertIsInstance( get_bookmark_lookup().category('apples-green'), Category) self.assertIsInstance( get_bookmark_lookup().location('http://apples.com/tasty1.jpg'), Location)
def category_detail(slug): category = get_bookmark_lookup().category(slug) return render_template( 'category_detail.html', category=CategoryPresenter(category).to_object())
def bookmark_detail(slug): bookmark = get_bookmark_lookup().bookmark(slug) return render_template( 'bookmark_detail.html', bookmark=BookmarkPresenter(bookmark).to_object())