#NEWLINE# def test_proxy_with_datetime( self ) : #NEWLINE# #INDENT# the_date = datetime . datetime ( 2012 , 12 , 1 , 5 , 5 , 5 ) #NEWLINE# validator = mock . Mock ( return_value = the_date ) #NEWLINE# value_proxy = proxy . ValueProxy ( validator , self . value_cache , 'something' ) #NEWLINE# assert_equal ( value_proxy , the_date ) #NEWLINE# assert ( value_proxy < datetime . datetime ( 2012 , 12 , 3 ) ) #NEWLINE# assert ( value_proxy > datetime . datetime ( 2012 , 1 , 4 ) ) #NEWLINE# four_days_ahead = datetime . datetime ( 2012 , 12 , 4 , 5 , 5 , 5 ) #NEWLINE# assert_equal ( ( value_proxy + datetime . timedelta ( days = 3 ) ) , four_days_ahead ) #NEWLINE# assert_equal ( repr ( value_proxy ) , repr ( the_date ) ) #NEWLINE# assert_equal ( str ( value_proxy ) , str ( validator ) ) #NEWLINE# assert_equal ( hash ( value_proxy ) , hash ( the_date ) ) #NEWLINE# assert bool ( value_proxy )