#NEWLINE# def test_endless_paginator( self ) : #NEWLINE# #INDENT# objects = range ( 1 , 100 ) #NEWLINE# paginator = EndlessPaginator ( objects , 1 ) #NEWLINE# for num in paginator : #NEWLINE# #INDENT# page = paginator . get_context ( num ) #NEWLINE# self . assertEquals ( page [ 'objects' ] , [ num ] ) #NEWLINE# self . assertEquals ( page [ 'has_next' ] , ( num < 99 ) ) #NEWLINE# self . assertEquals ( page [ 'has_previous' ] , ( num > 1 ) ) #NEWLINE# self . assertEquals ( page [ 'is_first' ] , ( num == 1 ) ) #NEWLINE# self . assertEquals ( page [ 'is_last' ] , ( num == 99 ) ) #NEWLINE# self . assertEquals ( page [ 'previous_page' ] , ( ( num - 1 ) if num else False ) ) #NEWLINE# self . assertEquals ( page [ 'next_page' ] , ( num + 1 ) ) #NEWLINE# self . assertEquals ( page [ 'page' ] , num )