#NEWLINE# def check_dates( self , valid_dates , title , one_year = True ) : #NEWLINE# #INDENT# "\n        Checks the dates in the given valid_dates dict. Also check that the\n        event title appears on the page when it's supposed to.\n        " #NEWLINE# for ( year , dates ) in valid_dates . items ( ) : #NEWLINE# #INDENT# for ( month , days ) in dates . items ( ) : #NEWLINE# #INDENT# response = self . client . get ( reverse ( 'calendar:list' , kwargs = { #NEWLINE# #INDENT# 'year' : year , #NEWLINE# 'month' : month , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . clean_whitespace ( response ) #NEWLINE# if days : #NEWLINE# #INDENT# self . assertContains ( response , title ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertNotContains ( response , title ) #NEWLINE# #UNINDENT# for day in days : #NEWLINE# #INDENT# [ self . assertContains ( response , self . cal_str ( day ) ) for day in days ] #NEWLINE# [ self . assertNotContains ( response , self . cal_str ( day ) ) for day in xrange ( 1 , ( monthrange ( 2014 , int ( month ) ) [ 1 ] + 1 ) ) if ( day not in days ) ] #NEWLINE# #UNINDENT# if one_year : #NEWLINE# #INDENT# response = self . client . get ( reverse ( 'calendar:list' , kwargs = { #NEWLINE# #INDENT# 'year' : str ( ( int ( year ) + 1 ) ) , #NEWLINE# 'month' : month , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . clean_whitespace ( response ) #NEWLINE# self . assertNotContains ( response , title )