#NEWLINE# def test_mixed_type_annotation_date_interval( self ) : #NEWLINE# #INDENT# active = datetime . datetime ( 2015 , 3 , 20 , 14 , 0 , 0 ) #NEWLINE# duration = datetime . timedelta ( hours = 1 ) #NEWLINE# expires = ( datetime . datetime ( 2015 , 3 , 20 , 14 , 0 , 0 ) + self ) #NEWLINE# Ticket . objects . create ( active_at = active , duration = duration ) #NEWLINE# t = Ticket . objects . annotate ( expires = ExpressionWrapper ( ( F ( 'active_at' ) + F ( 'duration' ) ) , output_field = DateTimeField ( ) ) ) . first ( ) #NEWLINE# self . assertEqual ( t . expires , expires )