def get_bs_object_for_view(request, view, user, object=None):
 with override_provides('service_provider_admin_form', ['shuup.testing.service_forms.PseudoPaymentProcessorForm', 'shuup.admin.modules.service_providers.forms:CustomCarrierForm', 'shuup.admin.modules.service_providers.forms:CustomPaymentProcessorForm']):
  request = apply_all_middleware(request, user=user)
  response = view(request, pk=(object.pk if object else None))
  if hasattr(response, 'render'):
   response.render()
  assert (response.status_code in [200, 302])
  return BeautifulSoup(response.content)

def get_bs_object_for_view ( request , view , user , object = None ) : with override_provides ( 'service_provider_admin_form' , [ 'shuup.testing.service_forms.PseudoPaymentProcessorForm' , 'shuup.admin.modules.service_providers.forms:CustomCarrierForm' , 'shuup.admin.modules.service_providers.forms:CustomPaymentProcessorForm' ] ) : request = apply_all_middleware ( request , user = user ) response = view ( request , pk = ( object . pk if object else None ) ) if hasattr ( response , 'render' ) : response . render ( ) assert ( response . status_code in [ 200 , 302 ] ) return BeautifulSoup ( response . content )
help function to get beautifulsoup object from the html rendered by the edit view .