[tests] reset frappe.local.form_dict

This commit is contained in:
Rushabh Mehta 2017-07-03 14:31:41 +05:30
parent 16ed88051e
commit eac06ccd77
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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("<label>First Name</label>" in print_html)
self.assertTrue(re.findall('<div class="col-xs-7[^"]*">[\s]*administrator[\s]*</div>', print_html))
return print_html