Пример #1
0
def index_from_year(request, year):
    """
    Shows the posts from the year specified in the year parameter.
    """
    posts = Post.published_posts_by_year(year)

    # Render paginated page
    return paginated_news_index(request, posts)
Пример #2
0
    def test_filter_on_date_range_works_as_expected(self):
        posts = Post.published_posts_by_year(2016)

        self.assertEqual(len(posts), 2)