2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-12-22 18:18:57 +00:00
frappe_docker/tests/_ping_frappe_connections.py
Revant Nandgaonkar a580385295
fix: traefik router for acme certs (#1068)
* fix: traefik router for acme certs

* fix: set default for sites

* test: use .localhost site names
2023-02-02 13:45:06 +05:30

27 lines
637 B
Python

import frappe
def check_db():
doc = frappe.get_single("System Settings")
assert any(v is None for v in doc.as_dict().values()), "Database test didn't pass"
print("Database works!")
def check_cache():
key_and_name = "mytestkey", "mytestname"
frappe.cache().hset(*key_and_name, "mytestvalue")
assert frappe.cache().hget(*key_and_name) == "mytestvalue", "Cache test didn't pass"
frappe.cache().hdel(*key_and_name)
print("Cache works!")
def main() -> int:
frappe.connect(site="tests.localhost")
check_db()
check_cache()
return 0
if __name__ == "__main__":
raise SystemExit(main())