rebuild(migration): validate local legacy cutover
This commit is contained in:
@@ -187,6 +187,25 @@ def test_birth_profile_is_encrypted_and_isolated_by_account(tmp_path) -> None:
|
||||
run_scenario(application, scenario)
|
||||
|
||||
|
||||
def test_incomplete_encrypted_profile_returns_controlled_error(tmp_path) -> None:
|
||||
application = create_application(Settings.for_test(tmp_path))
|
||||
|
||||
async def scenario(client: httpx.AsyncClient) -> None:
|
||||
response, _session = await register(client, "broken-profile", USER_PASSWORD)
|
||||
user_id = response.json()["account"]["id"]
|
||||
encrypted = application.state.container.accounts._cipher.encrypt('{"gender":"male"}')
|
||||
with sqlite3.connect(application.state.settings.database_path) as connection:
|
||||
connection.execute(
|
||||
"INSERT INTO birth_profiles VALUES (?,?,datetime('now'),datetime('now'))",
|
||||
(user_id, encrypted),
|
||||
)
|
||||
result = await client.get("/api/account/profile")
|
||||
assert result.status_code == 503
|
||||
assert result.json()["error"]["code"] == "profile_unavailable"
|
||||
|
||||
run_scenario(application, scenario)
|
||||
|
||||
|
||||
def test_membership_and_admin_are_independent_dimensions(tmp_path) -> None:
|
||||
application = create_application(Settings.for_test(tmp_path))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user