Refactored Binding for better concern consideration

This commit is contained in:
2025-11-02 18:46:44 +01:00
parent 7553c28f8e
commit 9696e67910
7 changed files with 459 additions and 84 deletions

View File

@@ -1,7 +1,5 @@
import dataclasses
import json
import uuid
from dataclasses import dataclass
from typing import Self
from bs4 import BeautifulSoup, Tag
@@ -11,6 +9,7 @@ from starlette.responses import Response
from starlette.testclient import TestClient
from myfasthtml.core.utils import mount_utils
from myfasthtml.test.MyFT import MyFT
verbs = {
'hx_get': 'GET',
@@ -21,14 +20,6 @@ verbs = {
}
@dataclass
class MyFT:
tag: str
attrs: dict
children: list['MyFT'] = dataclasses.field(default_factory=list)
text: str | None = None
class TestableElement:
"""
Represents an HTML element that can be interacted with in tests.