@@ -0,0 +1,656 @@
+import unittest%0A%0Aimport frappe%0Afrom frappe.www.printview import get_html_and_style%0A%0A%0Aclass PrintViewTest(unittest.TestCase):%0A%09def test_print_view_without_errors(self):%0A%0A%09%09user = frappe.get_last_doc(%22User%22)%0A%0A%09%09messages_before = frappe.get_message_log()%0A%09%09ret = get_html_and_style(doc=user.as_json(), print_format=%22Standard%22, no_letterhead=1)%0A%09%09messages_after = frappe.get_message_log()%0A%0A%09%09if len(messages_after) %3E len(messages_before):%0A%09%09%09new_messages = messages_after%5Blen(messages_before):%5D%0A%09%09%09self.fail(%22Print view showing error/warnings: %5Cn%22%0A%09%09%09%09%09+ %22%5Cn%22.join(str(msg) for msg in new_messages))%0A%0A%09%09# html should exist%0A%09%09self.assertTrue(bool(ret%5B%22html%22%5D))%0A

print view should not show warning/errors (#14972)