def test_address_phase_authorized_user(rf, admin_user): request = apply_request_middleware(rf.get("/"), shop=get_default_shop(), customer=get_person_contact(admin_user)) view_func = AddressesPhase.as_view() resp = view_func(request) assert 'company' not in resp.context_data['form'].form_defs
def test_address_phase_anonymous_user(rf): request = apply_request_middleware(rf.get("/"), shop=get_default_shop()) view_func = AddressesPhase.as_view() resp = view_func(request) assert 'company' in resp.context_data['form'].form_defs