Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Replace usage of render with get_response #26088

Merged
1 change: 1 addition & 0 deletions .github/helper/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
bench get-app erpnext "${GITHUB_WORKSPACE}"
bench start &
bench --site test_site reinstall --yes
bench build --app frappe
4 changes: 2 additions & 2 deletions erpnext/portal/doctype/homepage/test_homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import frappe
import unittest
from frappe.utils import set_request
from frappe.website.render import render
from frappe.website.serve import get_response

class TestHomepage(unittest.TestCase):
def test_homepage_load(self):
set_request(method='GET', path='home')
response = render()
response = get_response()

self.assertEqual(response.status_code, 200)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest
from bs4 import BeautifulSoup
from frappe.utils import set_request
from frappe.website.render import render
from frappe.website.serve import get_response

class TestHomepageSection(unittest.TestCase):
def test_homepage_section_card(self):
Expand All @@ -26,7 +26,7 @@ def test_homepage_section_card(self):
pass

set_request(method='GET', path='home')
response = render()
response = get_response()

self.assertEqual(response.status_code, 200)

Expand Down Expand Up @@ -59,7 +59,7 @@ def test_homepage_section_custom_html(self):
}).insert()

set_request(method='GET', path='home')
response = render()
response = get_response()

self.assertEqual(response.status_code, 200)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

from bs4 import BeautifulSoup
import frappe, unittest
from frappe.utils import set_request, get_html_for_route
from frappe.website.render import render
from frappe.utils import get_html_for_route
from erpnext.portal.product_configurator.utils import get_products_for_website
from erpnext.stock.doctype.item.test_item import make_item_variant

test_dependencies = ["Item"]

Expand Down
2 changes: 1 addition & 1 deletion erpnext/setup/doctype/item_group/item_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from frappe.utils import nowdate, cint, cstr
from frappe.utils.nestedset import NestedSet
from frappe.website.website_generator import WebsiteGenerator
from frappe.website.render import clear_cache
from frappe.website.utils import clear_cache
from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow
from erpnext.shopping_cart.product_info import set_product_info_for_website
from erpnext.utilities.product import get_qty_in_stock
Expand Down
2 changes: 1 addition & 1 deletion erpnext/stock/doctype/item/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from frappe.website.doctype.website_slideshow.website_slideshow import \
get_slideshow

from frappe.website.render import clear_cache
from frappe.website.utils import clear_cache
from frappe.website.website_generator import WebsiteGenerator


Expand Down
1 change: 0 additions & 1 deletion erpnext/templates/pages/partners.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from __future__ import unicode_literals
import frappe
import frappe.website.render

page_title = "Partners"

Expand Down