def test_company_contact_name_ext(): company = CompanyContact(name="TestCompany") assert company.name == "TestCompany" assert company.full_name == "TestCompany" company.name_ext = "California" company.save() assert company.name == "TestCompany" assert company.full_name == "TestCompany / California"
def test_company_still_linked_if_customer_contact_edited(regular_user): get_default_shop() person = get_person_contact(regular_user) assert not get_company_contact(regular_user) company = CompanyContact() company.save() company.members.add(person) assert get_company_contact(regular_user) client = SmartClient() client.login(username=REGULAR_USER_USERNAME, password=REGULAR_USER_PASSWORD) customer_edit_url = reverse("shuup:customer_edit") soup = client.soup(customer_edit_url) data = default_customer_data() data.update(default_address_data("billing")) data.update(default_address_data("shipping")) response, soup = client.response_and_soup(customer_edit_url, data, "post") assert response.status_code == 302 assert get_company_contact(regular_user)