test(projekt-matching): e2e helper scripts; component gates verified
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
19
projekt-matching/tests/e2e/cleanup_crm.py
Executable file
19
projekt-matching/tests/e2e/cleanup_crm.py
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Delete test opportunities whose cProjektlink contains a token."""
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
from projektmatch.espocrm import EspoClient # noqa: E402
|
||||
|
||||
TOKENS = sys.argv[1:] or [
|
||||
"python-entwickler-fuer-eine-ki-anwendung",
|
||||
"test-engineer-m-w-d-3020995",
|
||||
"nproj/3020338", "nproj/3020995"]
|
||||
espo = EspoClient(os.environ["PM_ESPO_BASE"], os.environ["PM_ESPO_API_KEY"])
|
||||
for token in TOKENS:
|
||||
for hit in espo.search("Opportunity", "contains", "cProjektlink", token,
|
||||
select="name,cProjektlink", max_size=100):
|
||||
espo.delete("Opportunity", hit["id"])
|
||||
print(f"deleted {hit['id']} {hit['name']}")
|
||||
print("cleanup done")
|
||||
Reference in New Issue
Block a user