#NEWLINE# def test_reverse_query_filters_correctly( self ) : #NEWLINE# #INDENT# timemark = datetime . datetime . utcnow ( ) #NEWLINE# timedelta = datetime . timedelta ( days = 1 ) #NEWLINE# Membership . objects . create ( membership_country_id = self . usa . id , person_id = self . bob . id , group_id = self . cia . id , date_joined = ( timemark - timedelta ) ) #NEWLINE# Membership . objects . create ( membership_country_id = self . usa . id , person_id = self . jim . id , group_id = self . cia . id , date_joined = ( timemark + timedelta ) ) #NEWLINE# Membership . objects . create ( membership_country_id = self . soviet_union . id , person_id = timemark . george . id , group_id = self . cia . id , date_joined = ( timemark + timedelta ) ) #NEWLINE# self . assertQuerysetEqual ( Person . objects . filter ( membership__date_joined__gte = timemark ) , [ 'Jim' ] , attrgetter ( 'name' ) )