@pytest.mark.django_db
def test_new_product_admin_form_renders(rf, client, admin_user):
 request = rf.get('/')
 request.user = admin_user
 request.session = client.session
 view = ProductEditView.as_view()
 shop = get_default_shop()
 supplier = get_simple_supplier()
 supplier.stock_managed = True
 supplier.save()
 view(request).render()
 supplier.stock_managed = False
 supplier.save()
 view(request).render()

@ pytest . mark . django_db def test_new_product_admin_form_renders ( rf , client , admin_user ) : request = rf . get ( '/' ) request . user = admin_user request . session = client . session view = ProductEditView . as_view ( ) shop = get_default_shop ( ) supplier = get_simple_supplier ( ) supplier . stock_managed = True supplier . save ( ) view ( request ) . render ( ) supplier . stock_managed = False supplier . save ( ) view ( request ) . render ( )
make sure that no exceptions are raised when creating a new product with simple supplier enabled .