(
tmp_path: pathlib.Path,
make_form_doc: typing.Callable,
settings: Settings,
client: TestClient,
csrf_token: str,
make_session_cookies: MakeSessionCookies,
)
| 176 | |
| 177 | |
| 178 | def test_submit_form( |
| 179 | tmp_path: pathlib.Path, |
| 180 | make_form_doc: typing.Callable, |
| 181 | settings: Settings, |
| 182 | client: TestClient, |
| 183 | csrf_token: str, |
| 184 | make_session_cookies: MakeSessionCookies, |
| 185 | ): |
| 186 | settings.BEANCOUNT_DIR = make_form_doc( |
| 187 | textwrap.dedent( |
| 188 | """\ |
| 189 | forms: |
| 190 | - name: form0 |
| 191 | fields: |
| 192 | - name: name |
| 193 | type: str |
| 194 | operations: |
| 195 | - type: append |
| 196 | file: main.bean |
| 197 | content: "; name={{ name }}" |
| 198 | """ |
| 199 | ) |
| 200 | ) |
| 201 | resp = client.post( |
| 202 | "/form/form0", |
| 203 | data=dict(name="mock-name", csrf_token=csrf_token), |
| 204 | cookies=make_session_cookies(), |
| 205 | ) |
| 206 | assert resp.status_code == 200 |
| 207 | |
| 208 | main_bean = tmp_path / "main.bean" |
| 209 | assert "; name=mock-name" in main_bean.read_text() |
nothing calls this directly
no test coverage detected