def test_party_from_contact_person_name_with_long_care_of( django_db_setup, contact_factory, first_name, last_name, expected1, expected2, expected3, expected4, ): contact = contact_factory( first_name=first_name, last_name=last_name, type=ContactType.PERSON, care_of= "Something random super long care of name 123456789abcdefghijklmnopqrstuvwxyz" "zyxwvutsrqponmlkjihgfedcba987654321 eman fo erac gnol repus modnar gnihtemoS", ) party = Party() party.from_contact(contact) assert party.priority_name1 == expected1, "priority_name1" assert party.priority_name2 == expected2, "priority_name2" assert party.priority_name3 == expected3, "priority_name3" assert party.priority_name4 == expected4, "priority_name4" assert party.info_name1 == expected1, "info_name1" assert party.info_name2 == expected2, "info_name2" assert party.info_name3 == expected3, "info_name3" assert party.info_name4 == expected4, "info_name4"
def test_party_from_contact_person_name( django_db_setup, contact_factory, first_name, last_name, expected1, expected2, expected3, expected4, ): contact = contact_factory(first_name=first_name, last_name=last_name, type=ContactType.PERSON) party = Party() party.from_contact(contact) assert party.priority_name1 == expected1 assert party.priority_name2 == expected2 assert party.priority_name3 == expected3 assert party.priority_name4 == expected4 assert party.info_name1 == expected1 assert party.info_name2 == expected2 assert party.info_name3 == expected3 assert party.info_name4 == expected4
def test_party_from_contact_person_name_with_care_of( django_db_setup, contact_factory, first_name, last_name, expected1, expected2, expected3, expected4, ): contact = contact_factory( first_name=first_name, last_name=last_name, type=ContactType.PERSON, care_of="Something random", ) party = Party() party.from_contact(contact) assert party.priority_name1 == expected1, "priority_name1" assert party.priority_name2 == expected2, "priority_name2" assert party.priority_name3 == expected3, "priority_name3" assert party.priority_name4 == expected4, "priority_name4" assert party.info_name1 == expected1, "info_name1" assert party.info_name2 == expected2, "info_name2" assert party.info_name3 == expected3, "info_name3" assert party.info_name4 == expected4, "info_name4"
def test_party_from_contact_name(django_db_setup, contact_factory, name, expected1, expected2, expected3, expected4): contact = contact_factory(name=name, type=ContactType.BUSINESS) party = Party() party.from_contact(contact) assert party.priority_name1 == expected1 assert party.priority_name2 == expected2 assert party.priority_name3 == expected3 assert party.priority_name4 == expected4 assert party.info_name1 == expected1 assert party.info_name2 == expected2 assert party.info_name3 == expected3 assert party.info_name4 == expected4
def test_party_from_contact_name_with_care_of(django_db_setup, contact_factory, name, expected1, expected2, expected3, expected4): contact = contact_factory(name=name, type=ContactType.BUSINESS, care_of="Something random") party = Party() party.from_contact(contact) assert party.priority_name1 == expected1, "priority_name1" assert party.priority_name2 == expected2, "priority_name2" assert party.priority_name3 == expected3, "priority_name3" assert party.priority_name4 == expected4, "priority_name4" assert party.info_name1 == expected1, "info_name1" assert party.info_name2 == expected2, "info_name2" assert party.info_name3 == expected3, "info_name3" assert party.info_name4 == expected4, "info_name4"
def test_party_from_contact_person_with_long_care_of(django_db_setup, contact_factory, name, expected1, expected2, expected3, expected4): contact = contact_factory( name=name, type=ContactType.BUSINESS, care_of= 'Something random super long care of name 123456789abcdefghijklmnopqrstuvwxyz' 'zyxwvutsrqponmlkjihgfedcba987654321 eman fo erac gnol repus modnar gnihtemoS' ) party = Party() party.from_contact(contact) assert party.priority_name1 == expected1, 'priority_name1' assert party.priority_name2 == expected2, 'priority_name2' assert party.priority_name3 == expected3, 'priority_name3' assert party.priority_name4 == expected4, 'priority_name4' assert party.info_name1 == expected1, 'info_name1' assert party.info_name2 == expected2, 'info_name2' assert party.info_name3 == expected3, 'info_name3' assert party.info_name4 == expected4, 'info_name4'
def test_invalid_party_contact(): party = Party() with pytest.raises(ValidationError): party.from_contact(None)