def test_remap_oscar_billing_address_full(): address = { 'first_name': 'John', 'last_name': 'Smith', 'line1': '1234 Fake Street', 'line2': '', 'line3': '', 'line4': 'Toronto', 'state': 'Ontario', 'postcode': 'O1O 1O1', 'country': 'Canada', 'phone_number': '123-456-7896', } remapped = bridge_oscar.remap_oscar_billing_address(address) assert len(remapped) == 8 assert remapped['billing_contact_name'] == 'John Smith' assert remapped['billing_street_1'] == '1234 Fake Street' assert remapped['billing_street_2'] == '' assert remapped['billing_city'] == 'Toronto' assert remapped['billing_province'] == 'Ontario' assert remapped['billing_postal_code'] == 'O1O 1O1' assert remapped['billing_country'] == 'Canada' assert remapped['billing_phone'] == '123-456-7896'
def test_remap_oscar_billing_address_last_name_only(): address = { 'last_name': 'Smith', } remapped = bridge_oscar.remap_oscar_billing_address(address) assert remapped['billing_contact_name'] == 'Smith'
def test_remap_oscar_billing_address_first_name_only(): address = { 'first_name': 'John', } remapped = bridge_oscar.remap_oscar_billing_address(address) assert remapped['billing_contact_name'] == 'John'
def test_remap_oscar_billing_address_patial(): address = { 'first_name': 'John', 'last_name': 'Smith', 'line1': '1234 Fake Street', } remapped = bridge_oscar.remap_oscar_billing_address(address) assert remapped['billing_contact_name'] == 'John Smith' assert remapped['billing_street_1'] == '1234 Fake Street' assert remapped['billing_street_2'] is None assert remapped['billing_city'] is None assert remapped['billing_province'] is None assert remapped['billing_postal_code'] is None assert remapped['billing_country'] is None assert remapped['billing_phone'] is None
def test_remap_oscar_billing_address_no_name(): remapped = bridge_oscar.remap_oscar_billing_address({}) assert remapped['billing_contact_name'] is None