@pytest.mark.parametrize('type,extra_inputs', [('shuup.custompaymentprocessor', ['rounding_quantize']), ('shuup_testing.pseudopaymentprocessor', ['bg_color', 'fg_color'])])
def test_new_service_provider_form_fields(rf, admin_user, type, extra_inputs):
 with override_settings(LANGUAGES=[('en', 'en')]):
  base_inputs = ['csrfmiddlewaretoken', 'name__en', 'enabled', 'logo']
  get_default_shop()
  view = ServiceProviderEditView.as_view()
  soup = get_bs_object_for_view(rf.get(('?type=%s' % type)), view, admin_user)
  provider_form = soup.find('form', attrs={'id': 'service_provider_form'})
  rendered_fields = []
  for input_field in provider_form.findAll('input'):
   rendered_fields.append(input_field['name'])
  assert (rendered_fields == (base_inputs + extra_inputs))

@ pytest . mark . parametrize ( 'type,extra_inputs' , [ ( 'shuup.custompaymentprocessor' , [ 'rounding_quantize' ] ) , ( 'shuup_testing.pseudopaymentprocessor' , [ 'bg_color' , 'fg_color' ] ) ] ) def test_new_service_provider_form_fields ( rf , admin_user , type , extra_inputs ) : with override_settings ( LANGUAGES = [ ( 'en' , 'en' ) ] ) : base_inputs = [ 'csrfmiddlewaretoken' , 'name__en' , 'enabled' , 'logo' ] get_default_shop ( ) view = ServiceProviderEditView . as_view ( ) soup = get_bs_object_for_view ( rf . get ( ( '?type=%s' % type ) ) , view , admin_user ) provider_form = soup . find ( 'form' , attrs = { 'id' : 'service_provider_form' } ) rendered_fields = [ ] for input_field in provider_form . findAll ( 'input' ) : rendered_fields . append ( input_field [ 'name' ] ) assert ( rendered_fields == ( base_inputs + extra_inputs ) )
test serviceprovideeditview fields in new mode .