Merge branch 'frappe:develop' into blog-email-notification

This commit is contained in:
Shariq Ansari 2021-11-17 20:24:38 +05:30 committed by GitHub
commit d896aefda8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View file

@ -0,0 +1,22 @@
import unittest
import frappe
from frappe.www.printview import get_html_and_style
class PrintViewTest(unittest.TestCase):
def test_print_view_without_errors(self):
user = frappe.get_last_doc("User")
messages_before = frappe.get_message_log()
ret = get_html_and_style(doc=user.as_json(), print_format="Standard", no_letterhead=1)
messages_after = frappe.get_message_log()
if len(messages_after) > len(messages_before):
new_messages = messages_after[len(messages_before):]
self.fail("Print view showing error/warnings: \n"
+ "\n".join(str(msg) for msg in new_messages))
# html should exist
self.assertTrue(bool(ret["html"]))

View file

@ -45,7 +45,7 @@ def get_context(context):
"lang": frappe.local.lang,
"sounds": hooks["sounds"],
"boot": boot if context.get("for_mobile") else boot_json,
"desk_theme": desk_theme,
"desk_theme": desk_theme or "Light",
"csrf_token": csrf_token,
"google_analytics_id": frappe.conf.get("google_analytics_id"),
"google_analytics_anonymize_ip": frappe.conf.get("google_analytics_anonymize_ip"),