No project description provided
Project description
pytest oarepo
Pytest fixtures and other test code for OARepo.
The module is divided into different parts for basic repositories, repositories with requests and repositories with communities.
How to use:
For fixtures, add to your conftest.py following
pytest_plugins = [
"pytest_oarepo.requests.fixtures",
"pytest_oarepo.records",
"pytest_oarepo.fixtures",
"pytest_oarepo.users",
]
Other code can be imported like everything else
The basic package contains:
- constants
- DEFAULT_RECORD_JSON - basic data for record creation without workflow
- DEFAULT_RECORD_WITH_WORKFLOW_JSON - the same but with explicitly added default workflow
- fixtures
- vocab_cf - initiates OARepo defined custom fields, expected to be used as autouse where needed
- logged_client - wrapper ensuring the correct user sends an api request
- functions
- link2testclient - transforms resource link to form used by pytest test clients
- is_valid_subdict - checks whether dictionary is valid subdictionary and saves where they differ if not
- records
- draft_factory - creates instance of a draft, additionally allows specifyong custom workflow, additional draft data, expand and other keywords arguments for the record service
- record_factory - the same for published records
- record_with_files_factory - the same for published records with attached file
- users
- a bunch of user fixtures
The requests module contains
- constants
- EVENTS_RESOURCE_DATA = data for creation of basic request event
- fixtures
- requests_service - basic requests service
- requests_events_service - basic service for creating request events
- oarepo_requests_service - oarepo requests service
- role - Returns a group object that can be used as receiver of a request for example.
- role_ui_serialization - Returns an expected ui serialization of the group object
- request_type_additional_data - function giving additional data if specific request type needs them
- create_request - creates specific request on a specific record
- submit_request - creates and submits specific request on a specific record
The communities module contains
- fixtures
- community_inclusion_service - service for direct inclusion and exclusion of records from communities
- community_records_service - service for communities related record creations and searches
- init_communities_cf - init oarepo specific custom fields including the ones relevant for communities, expected to be used with autouse
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_oarepo-1.0.1.tar.gz.
File metadata
- Download URL: pytest_oarepo-1.0.1.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c31629b6ebd7a96457cb7eb33372522c93caae2d68bca7e94b9dd298a80fe319
|
|
| MD5 |
81ded41e7b9155205a98bb63a42fc94b
|
|
| BLAKE2b-256 |
59153cccbbbc3d5711c294c36f6debe3eb633f43c2f5edf08ffbe9ff78af0d7d
|
File details
Details for the file pytest_oarepo-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pytest_oarepo-1.0.1-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e2a6d96cf83104cf51936e174d85549a30e8e8b729c0d4f0049aff54918f9a4
|
|
| MD5 |
022f32cb5bd5849cc719bbb9ada8c93e
|
|
| BLAKE2b-256 |
df14f416018dafdfc8d5c6ae36e915e17341c5ff74fd8dd25f4fe3805a24bafa
|