개선관리 요구사항과 Google 로그인을 완료
This commit is contained in:
parent
cc0a15b7c6
commit
2a39636163
112 changed files with 10166 additions and 527 deletions
|
|
@ -3,10 +3,13 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from starlette.requests import Request
|
||||
|
||||
from . import session_persistence
|
||||
from . import auth_sessions
|
||||
from .deps import Principal, Role
|
||||
from .routes import sessions
|
||||
from .routes import share as share_routes
|
||||
|
|
@ -156,3 +159,25 @@ class SessionShareTest(unittest.IsolatedAsyncioTestCase):
|
|||
with self.assertRaises(share_routes.HTTPException) as caught:
|
||||
await share_routes._load_share_or_404(token)
|
||||
self.assertEqual(caught.exception.status_code, 404)
|
||||
|
||||
async def test_current_feedback_off_blocks_an_existing_public_share(self) -> None:
|
||||
principal = _principal()
|
||||
_ended_session(principal)
|
||||
response = await sessions.create_session_share(
|
||||
"share-test-session",
|
||||
_request(),
|
||||
principal,
|
||||
)
|
||||
token = response.shareUrl.rsplit("/", 1)[-1]
|
||||
|
||||
with patch.object(
|
||||
auth_sessions,
|
||||
"get_managed_user",
|
||||
AsyncMock(
|
||||
return_value=SimpleNamespace(learner_feedback_enabled=False)
|
||||
),
|
||||
):
|
||||
with self.assertRaises(share_routes.HTTPException) as caught:
|
||||
await share_routes._load_share_or_404(token)
|
||||
|
||||
self.assertEqual(caught.exception.status_code, 404)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue