From eac06ccd77c4d1ccf4df3dbd802c7b029901d279 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 3 Jul 2017 14:31:41 +0530 Subject: [PATCH] [tests] reset frappe.local.form_dict --- .../doctype/authentication_log/test_authentication_log.py | 7 ++++--- frappe/printing/doctype/print_format/test_print_format.py | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frappe/core/doctype/authentication_log/test_authentication_log.py b/frappe/core/doctype/authentication_log/test_authentication_log.py index 3b59cc33da..ff2ccc5e98 100644 --- a/frappe/core/doctype/authentication_log/test_authentication_log.py +++ b/frappe/core/doctype/authentication_log/test_authentication_log.py @@ -13,9 +13,8 @@ class TestAuthenticationLog(unittest.TestCase): from frappe.auth import LoginManager, CookieManager # test user login log - frappe.local.form_dict = frappe._dict(cmd='login') - - frappe.form_dict = frappe._dict({ + frappe.local.form_dict = frappe._dict({ + 'cmd': 'login' 'sid': 'Guest', 'pwd': 'admin', 'usr': 'Administrator' @@ -38,6 +37,8 @@ class TestAuthenticationLog(unittest.TestCase): auth_log = self.get_auth_log() self.assertEquals(auth_log.status, 'Failed') + frappe.local.form_dict = _dict() + def get_auth_log(self, operation='Login'): names = frappe.db.sql_list("""select name from `tabAuthentication Log` where user='Administrator' and operation='{operation}' order by diff --git a/frappe/printing/doctype/print_format/test_print_format.py b/frappe/printing/doctype/print_format/test_print_format.py index 92a85dda17..a32070e97b 100644 --- a/frappe/printing/doctype/print_format/test_print_format.py +++ b/frappe/printing/doctype/print_format/test_print_format.py @@ -11,7 +11,6 @@ test_records = frappe.get_test_records('Print Format') class TestPrintFormat(unittest.TestCase): def test_print_user(self, style=None): print_html = frappe.get_print("User", "Administrator", style=style) - print(print_html) self.assertTrue("" in print_html) self.assertTrue(re.findall('
[\s]*administrator[\s]*
', print_html)) return print_html