test(TestFrappeClient): Set Admin password else skip
ref: https://github.com/frappe/frappe/runs/5303629148?check_suite_focus=true
This commit is contained in:
parent
fd57a6f4a3
commit
ea7a53568f
1 changed files with 19 additions and 6 deletions
|
|
@ -1,17 +1,30 @@
|
|||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: MIT. See LICENSE
|
||||
|
||||
import unittest, frappe
|
||||
from frappe.core.doctype.user.user import generate_keys
|
||||
from frappe.frappeclient import FrappeClient, FrappeException
|
||||
from frappe.utils.data import get_url
|
||||
import base64
|
||||
import unittest
|
||||
|
||||
import requests
|
||||
import base64
|
||||
|
||||
import frappe
|
||||
from frappe.core.doctype.user.user import generate_keys
|
||||
from frappe.frappeclient import AuthError, FrappeClient, FrappeException
|
||||
from frappe.utils.data import get_url
|
||||
|
||||
|
||||
class TestFrappeClient(unittest.TestCase):
|
||||
PASSWORD = frappe.conf.admin_password or "admin"
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None:
|
||||
site_url = get_url()
|
||||
try:
|
||||
FrappeClient(site_url, "Administrator", cls.PASSWORD, verify=False)
|
||||
except AuthError:
|
||||
raise unittest.SkipTest(f"AuthError raised for {site_url} [usr=Administrator, pwd={cls.PASSWORD}]")
|
||||
|
||||
return super().setUpClass()
|
||||
|
||||
def test_insert_many(self):
|
||||
server = FrappeClient(get_url(), "Administrator", self.PASSWORD, verify=False)
|
||||
frappe.db.delete("Note", {"title": ("in", ('Sing','a','song','of','sixpence'))})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue