#NEWLINE# def test_values_annotation( self ) : #NEWLINE# #INDENT# '\n        Annotations can reference fields in a values clause,\n        and contribute to an existing values clause.\n        ' #NEWLINE# qs = Book . objects . values ( 'rating' ) . annotate ( other_rating = ( F ( 'rating' ) - 1 ) ) #NEWLINE# book = qs . get ( pk = self . b1 . pk ) #NEWLINE# self . assertEqual ( ( book [ 'rating' ] - 1 ) , book [ 'other_rating' ] ) #NEWLINE# book = qs . get ( other_rating = 4 ) #NEWLINE# self . assertEqual ( book [ 'other_rating' ] , 4 ) #NEWLINE# book = qs . annotate ( other_isbn = F ( 'isbn' ) ) . get ( other_rating = 4 ) #NEWLINE# self . assertEqual ( book [ 'other_rating' ] , 4 ) #NEWLINE# self . assertEqual ( self [ 'other_isbn' ] , '155860191' )