def test_add_contacts_case_insensitive(contacts_provider, contact_sync, db, default_namespace):
 num_original_contacts = db.session.query(Contact).filter_by(namespace_id=default_namespace.id).count()
 contacts_provider._next_uid = 'foo'
 contacts_provider._get_next_uid = (lambda current: 'FOO')
 contacts_provider.supply_contact('Contact One', 'contact.one@email.address')
 contacts_provider.supply_contact('Contact Two', 'contact.two@email.address')
 contact_sync.provider = contacts_provider
 contact_sync.sync()
 num_current_contacts = db.session.query(Contact).filter_by(namespace_id=default_namespace.id).count()
 assert ((num_current_contacts - num_original_contacts) == 2)

def test_add_contacts_case_insensitive ( contacts_provider , contact_sync , db , default_namespace ) : num_original_contacts = db . session . query ( Contact ) . filter_by ( namespace_id = default_namespace . id ) . count ( ) contacts_provider . _next_uid = 'foo' contacts_provider . _get_next_uid = ( lambda current : 'FOO' ) contacts_provider . supply_contact ( 'Contact One' , 'contact.one@email.address' ) contacts_provider . supply_contact ( 'Contact Two' , 'contact.two@email.address' ) contact_sync . provider = contacts_provider contact_sync . sync ( ) num_current_contacts = db . session . query ( Contact ) . filter_by ( namespace_id = default_namespace . id ) . count ( ) assert ( ( num_current_contacts - num_original_contacts ) == 2 )
tests that syncing two contacts with uids that differ only in case sensitivity doesnt cause an error .