Quellcode durchsuchen

[tests] reset frappe.local.form_dict

version-14
Rushabh Mehta vor 8 Jahren
Ursprung
Commit
eac06ccd77
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. +4
    -3
      frappe/core/doctype/authentication_log/test_authentication_log.py
  2. +0
    -1
      frappe/printing/doctype/print_format/test_print_format.py

+ 4
- 3
frappe/core/doctype/authentication_log/test_authentication_log.py Datei anzeigen

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


+ 0
- 1
frappe/printing/doctype/print_format/test_print_format.py Datei anzeigen

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


Laden…
Abbrechen
Speichern