#NEWLINE# def test_models( testbed ) : #NEWLINE# #INDENT# addressbook_key = ndb . Key ( 'AddressBook' , 'tmatsuo' ) #NEWLINE# friends = models . Group ( parent = addressbook_key , name = 'friends' ) #NEWLINE# friends . put ( ) #NEWLINE# friends_key = friends . key #NEWLINE# mary = models . Contact ( parent = addressbook_key , name = 'Mary' ) #NEWLINE# mary . put ( ) #NEWLINE# mary_key = mary . key #NEWLINE# mary = mary_key . get ( ) #NEWLINE# friends = friends_key . get ( ) #NEWLINE# if ( friends . key not in mary . groups ) : #NEWLINE# #INDENT# mary . groups . append ( friends . key ) #NEWLINE# mary . put ( ) #NEWLINE# #UNINDENT# mary = mary_key . get ( ) #NEWLINE# assert ( friends . key in mary . groups ) #NEWLINE# friend_list = friends . members . fetch ( ) #NEWLINE# assert ( len ( friend_list ) == 1 )