#NEWLINE# def check_pagination( self , url , expected_status_code , object_count = None ) : #NEWLINE# #INDENT# response = self . client . get ( url ) #NEWLINE# self . assertEqual ( response . status_code , expected_status_code ) #NEWLINE# if object_count : #NEWLINE# #INDENT# self . assertEqual ( response . context [ 'is_paginated' ] , True ) #NEWLINE# self . assertEqual ( len ( response . context [ 'page_obj' ] . object_list ) , object_count ) #NEWLINE# #UNINDENT# return response