예제 #1
0
    def test_empty_page(self):
        pets, _ = paginate_pets(Pet.objects.all(), 42)

        self.assertEqual(1, len(pets))
        self.assertEqual('First Kind', pets[0].kind.kind)
예제 #2
0
    def test_page_not_integer(self):
        pets, _ = paginate_pets(Pet.objects.all(), 'page')

        self.assertEqual(1, len(pets))
        self.assertEqual('First Kind', pets[0].kind.kind)
예제 #3
0
파일: tests.py 프로젝트: tekodan/pets
    def test_empty_page(self):
        """If the user inform an empty page we should present the last page with data"""
        pets, _ = paginate_pets(Pet.objects.all(), 42)

        self.assertEqual(1, len(pets))
        self.assertEqual('First Kind', pets[0].kind.kind)
예제 #4
0
파일: tests.py 프로젝트: tekodan/pets
    def test_page_not_integer(self):
        """In case of a non-integer page, i.e, incorrent url, we should show the first page"""
        pets, _ = paginate_pets(Pet.objects.all(), 'page')

        self.assertEqual(1, len(pets))
        self.assertEqual('First Kind', pets[0].kind.kind)
예제 #5
0
파일: tests.py 프로젝트: dirtycoder/pets
    def test_empty_page(self):
        """If the user inform an empty page we should present the last page with data"""
        pets, _ = paginate_pets(Pet.objects.all(), 42)

        self.assertEqual(1, len(pets))
        self.assertEqual('First Kind', pets[0].kind.kind)
예제 #6
0
파일: tests.py 프로젝트: dirtycoder/pets
    def test_page_not_integer(self):
        """In case of a non-integer page, i.e, incorrent url, we should show the first page"""
        pets, _ = paginate_pets(Pet.objects.all(), 'page')

        self.assertEqual(1, len(pets))
        self.assertEqual('First Kind', pets[0].kind.kind)