"""Pytest fixutres for fan-preference-sforce-updates.""" import pytest @pytest.fixture def fan_updated_full(): """Mock Fan update message including all fields.""" return { 'id': '5fb6ed75-f775-4384-9021-e6c9fabb7ce7', 'crmId': 'arUQAvjFGaKEesRUXnkI', 'updatedAt': '2010-12-09T14:47:04', 'updatedFields': [ { 'fieldName': 'phoneNumber', 'oldValue': '+37255555555', 'newValue': '+37266666666' }, { 'fieldName': 'address', 'oldValue': 'Street 1', 'newValue': 'Street 2' }, { 'fieldName': 'city', 'oldValue': 'Tallinn', 'newValue': 'New York' }, { 'fieldName': 'birthday', 'oldValue': '06/16', 'newValue': '06/30' }, { 'fieldName': 'dateOfBirth', 'oldValue': '1990-06-16', 'newValue': '1990-06-30' }, { 'fieldName': 'countryCode', 'oldValue': 'EE', 'newValue': 'US' }, { 'fieldName': 'email', 'oldValue': 'old@mail.com', 'newValue': 'new@mail.com' }, { 'fieldName': 'gender', 'oldValue': 'MALE', 'newValue': 'FEMALE' }, { 'fieldName': 'firstName', 'oldValue': 'Peter', 'newValue': 'Mary' }, { 'fieldName': 'lastName', 'oldValue': 'Parker', 'newValue': 'Jane' }, { 'fieldName': 'zipCode', 'oldValue': '12345', 'newValue': '54321' } ] } @pytest.fixture def fan_updated_email_only(): """Mock Fan update message with incomplete/only email update.""" return { 'id': '5fb6ed75-f775-4384-9021-e6c9fabb7ce7', 'crmId': 'arUQAvjFGaKEesRUXnkI', 'updatedAt': '2010-12-09T14:47:04', 'updatedFields': [ { 'fieldName': 'email', 'oldValue': 'old@mail.com', 'newValue': 'new@mail.com' } ] } @pytest.fixture def fan_updated_with_nullables(): """Mock Fan update message with incomplete/only email update.""" return { 'id': '5fb6ed75-f775-4384-9021-e6c9fabb7ce7', 'crmId': 'arUQAvjFGaKEesRUXnkI', 'updatedAt': '2010-12-09T14:47:04', 'updatedFields': [ { 'fieldName': 'phoneNumber', 'oldValue': '+37255000111', 'newValue': None, } ] } @pytest.fixture def fan_deleted(): """Mock Fan delete update.""" return { 'id': '5fb6ed75-f775-4384-9021-e6c9fabb7ce7', 'crmId': 'arUQAvjFGaKEesRUXnkI', 'deletedAt': '2010-12-09T14:47:04' } @pytest.fixture def fan_no_crmId(): """Mock Fan update message with no crmId set.""" return { 'id': '5fb6ed75-f775-4384-9021-e6c9fabb7ce7', 'crmId': None, 'updatedAt': '2010-12-09T14:47:04', 'updatedFields': [ { 'fieldName': 'email', 'oldValue': 'old@mail.com', 'newValue': 'new@mail.com' } ] } @pytest.fixture def result_update_message_full(): """Mock resulting update full message.""" return { 'Birthdate__c': '1990-06-30', 'First_Name__c': 'Mary', 'Last_Name__c': 'Jane', 'Email__c': 'new@mail.com', 'Mobile_Phone__c': '+37266666666', 'Birthday_mm_dd__c': '06/30', 'Gender__c': 'FEMALE', 'Country_Region__c': 'US', 'City__c': 'New York', 'Address_1__c': 'Street 2', 'Postal_Code__c': '54321' }