Esempio n. 1
0
    def test_reflect_priorities(self):
        l = self.listings[-1]
        l.priority_value = 10
        l.priority_from = datetime.now() - timedelta(days=1)
        l.priority_to = datetime.now() + timedelta(days=1)
        l.save()

        c = _list_content_type('', '2008')
        expected = [l] + self.listings[:-1]
        self.assert_equals(expected, c['listings'])
Esempio n. 2
0
 def test_returns_empty_list_if_no_listing_found(self):
     c = _list_content_type('', '2007')
     self.assert_equals([], c['listings'])
Esempio n. 3
0
 def test_return_second_2_listings_if_paginate_by_2_and_page_2(self):
     c = _list_content_type('', '2008', page_no=2, paginate_by=2)
     self.assert_equals(self.listings[2:4], c['listings'])
     self.assert_true(c['is_paginated'])
Esempio n. 4
0
 def test_return_first_2_listings_if_paginate_by_2(self):
     c = _list_content_type('', '2008', paginate_by=2)
     self.assert_equals(self.listings[:2], c['listings'])
     self.assert_true(c['is_paginated'])
Esempio n. 5
0
 def test_only_nested_category_and_year_returns_all_listings(self):
     Listing.objects.all().update(category=self.category_nested_second)
     c = _list_content_type('nested-category/second-nested-category', '2008')
     self.assert_equals(self.listings, c['listings'])
Esempio n. 6
0
 def test_only_category_and_year_returns_all_listings(self):
     c = _list_content_type('', '2008')
     self.assert_equals(self.listings, c['listings'])