def test_update_contact(contacts_provider, contact_sync, db):
 contacts_provider.supply_contact('Old Name', 'old@email.address')
 contact_sync.provider = contacts_provider
 contact_sync.sync()
 results = db.session.query(Contact).all()
 email_addresses = [r.email_address for r in results]
 assert ('old@email.address' in email_addresses)
 contacts_provider.__init__()
 contacts_provider.supply_contact('New Name', 'new@email.address')
 contact_sync.sync()
 db.session.commit()
 results = db.session.query(Contact).all()
 names = [r.name for r in results]
 assert ('New Name' in names)
 email_addresses = [r.email_address for r in results]
 assert ('new@email.address' in email_addresses)

def test_update_contact ( contacts_provider , contact_sync , db ) : contacts_provider . supply_contact ( 'Old Name' , 'old@email.address' ) contact_sync . provider = contacts_provider contact_sync . sync ( ) results = db . session . query ( Contact ) . all ( ) email_addresses = [ r . email_address for r in results ] assert ( 'old@email.address' in email_addresses ) contacts_provider . __init__ ( ) contacts_provider . supply_contact ( 'New Name' , 'new@email.address' ) contact_sync . sync ( ) db . session . commit ( ) results = db . session . query ( Contact ) . all ( ) names = [ r . name for r in results ] assert ( 'New Name' in names ) email_addresses = [ r . email_address for r in results ] assert ( 'new@email.address' in email_addresses )
test that subsequent contact updates get stored .