Skip to content

Commit c57c16e

Browse files
boehlkeclaude
andcommitted
test: add Keycloak integration tests
- Backchannel logout tests - User migration tests (Argon2 hash import) - User sync tests (CRUD operations to Keycloak) - Update existing system tests for Keycloak-aware base classes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8d55cd1 commit c57c16e

52 files changed

Lines changed: 2709 additions & 1133 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/database/writer/system/test_create.py

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ def test_create_11_field_as_1n() -> None:
220220
assert_no_model("agenda_item/2")
221221

222222

223-
def test_create_error_own_field_not_null(
224-
db_connection: Connection[rows.DictRow],
225-
) -> None:
223+
def test_create_error_1_1_not_null(db_connection: Connection[rows.DictRow]) -> None:
226224
with get_new_os_conn() as conn:
227225
with pytest.raises(BadCodingException) as e_info:
228226
extended_database = ExtendedDatabase(conn, MagicMock(), MagicMock())
@@ -246,57 +244,6 @@ def test_create_error_own_field_not_null(
246244
)
247245

248246

249-
def test_create_error_1_1_not_null(
250-
db_connection: Connection[rows.DictRow],
251-
) -> None:
252-
create_models(get_group_base_data())
253-
with get_new_os_conn() as conn:
254-
with pytest.raises(DatabaseError) as e_info:
255-
extended_database = ExtendedDatabase(conn, MagicMock(), MagicMock())
256-
extended_database.write(
257-
create_write_requests(
258-
[
259-
{
260-
"events": [
261-
{
262-
"type": EventType.Create,
263-
"fqid": "motion/2",
264-
"fields": {
265-
"title": "2",
266-
"meeting_id": 1,
267-
"state_id": 1,
268-
},
269-
},
270-
]
271-
}
272-
]
273-
)
274-
)
275-
conn.commit()
276-
assert (
277-
"Trigger tr_i_motion_list_of_speakers_id: NOT NULL CONSTRAINT VIOLATED for motion/2/list_of_speakers_id"
278-
in e_info.value.args[0]
279-
)
280-
281-
282-
def test_create_error_1_n_not_null(
283-
db_connection: Connection[rows.DictRow],
284-
) -> None:
285-
events: list[dict[str, Any]] = get_group_base_data()
286-
del events[0]["events"][2]["fields"][
287-
"used_as_default_projector_for_topic_in_meeting_id"
288-
]
289-
with get_new_os_conn() as conn:
290-
with pytest.raises(DatabaseError) as e_info:
291-
extended_database = ExtendedDatabase(conn, MagicMock(), MagicMock())
292-
extended_database.write(create_write_requests(events))
293-
conn.commit()
294-
assert (
295-
"Trigger tr_i_meeting_default_projector_topic_ids: NOT NULL CONSTRAINT VIOLATED for meeting/1/default_projector_topic_ids"
296-
in e_info.value.args[0]
297-
)
298-
299-
300247
def test_create_error_n_m_not_null(
301248
db_connection: Connection[rows.DictRow],
302249
) -> None:

0 commit comments

Comments
 (0)