Some checks failed
Frontend / Unit Tests & Coverage (push) Has been skipped
Regenerate POT file (translatable strings) / Regenerate POT file (develop) (push) Failing after 1m13s
Regenerate POT file (translatable strings) / Regenerate POT file (main-hotfix) (push) Failing after 6s
Server / Tests (frappe ${{ matrix.frappe-branch }}) (push) Has been skipped
Server / Resolve frappe matrix (push) Failing after 1s
Frontend / Lint (push) Failing after 1s
Frontend / Production Build (push) Failing after 1s
Server / Coverage Wrap Up (push) Has been skipped
Frontend / Coverage Wrap Up (push) Has been skipped
23 lines
569 B
Python
23 lines
569 B
Python
import json
|
|
import os
|
|
|
|
import frappe
|
|
|
|
|
|
def before_tests():
|
|
load_crm_user_test_records()
|
|
|
|
|
|
def load_crm_user_test_records():
|
|
"""Load CRM user test records from crm/tests/test_records.json"""
|
|
test_records_path = os.path.join(os.path.dirname(__file__), "test_records.json")
|
|
|
|
if os.path.exists(test_records_path):
|
|
with open(test_records_path) as f:
|
|
test_records = json.load(f)
|
|
|
|
for record in test_records:
|
|
if not frappe.db.exists("User", record.get("email")):
|
|
doc = frappe.get_doc(record)
|
|
doc.insert(ignore_permissions=True, ignore_if_duplicate=True)
|