AKModel.tests.test_protocol_migration module
- class AKModel.tests.test_protocol_migration.ProtocolMigrationLinkTests(methodName='runTest')[source]
Bases:
TestCaseTest parsing of HedgeDoc and wiki links
- class AKModel.tests.test_protocol_migration.ProtocolMigrationTests(methodName='runTest')[source]
Bases:
TestCaseTest the migration of single protocols with mocked HedgeDoc, pandoc and wiki
- test_invalid_links()[source]
Test that missing or invalid links are reported without contacting any service
- AKModel.tests.test_protocol_migration.hedgedoc_response(status_code=200, content=None, content_type='text/markdown; charset=UTF-8', location=None)[source]
Create a mocked (streamed) response of HedgeDoc
- Parameters:
content – list of chunks of the body or an exception to raise when reading it
- AKModel.tests.test_protocol_migration.api_response(data, status_code=200)[source]
Create a mocked response of the MediaWiki API
- AKModel.tests.test_protocol_migration.token_response(token_type, token)[source]
Create a mocked response of the MediaWiki API to a token query
- class AKModel.tests.test_protocol_migration.MediaWikiClientTests(methodName='runTest')[source]
Bases:
TestCaseTest the MediaWiki API client with a mocked HTTP session
- test_get_page_login()[source]
Test that the login is performed before reading (wikis may require it for reading)
- test_get_page_not_regular()[source]
Test that special pages and interwiki titles are reported as invalid wiki links
- test_get_page_unexpected_response()[source]
Test that a page without revisions is reported as wiki error
- test_request_errors()[source]
Test that network errors, HTTP errors, API errors and invalid responses are reported as wiki errors
- test_login_cached()[source]
Test that logins are stored in the cache and reused by new clients (e.g., in the next request)
- test_write_empty_page()[source]
Test that existing empty pages are edited with edit conflict detection
- class AKModel.tests.test_protocol_migration.ProtocolDownloadAndConversionTests(methodName='runTest')[source]
Bases:
TestCaseTest downloading protocols from HedgeDoc and converting them using pandoc (via pypandoc)
- test_download_failed()[source]
Test that HTTP errors, redirects (e.g., to login), network errors and other content are reported
- test_fetch_public()[source]
Test that requests are sent to the checked address while TLS still uses the hostname
- class AKModel.tests.test_protocol_migration.MigrateProtocolsTests(methodName='runTest')[source]
Bases:
TestCaseTest the migration of multiple protocols
- class AKModel.tests.test_protocol_migration.ProtocolMigrationViewTests(methodName='runTest')[source]
Bases:
TestCaseTest the admin action and views for protocol migration
- test_admin_action()[source]
Test that the admin action redirects to the confirmation view with the selected AKs
- test_confirmation()[source]
Test that the confirmation page renders and lists the AKs with their links
- test_result()[source]
Test that the report page lists the AKs with one migration URL each but does not migrate anything itself
- test_migrate_single_errors()[source]
Test that the single migration only accepts POST requests for existing AKs
- test_change_permission_required()[source]
Test that staff users without permission to change AKs can neither see the action nor migrate protocols
Test that the action is only offered if wikis are configured