rdmo
rdmo copied to clipboard
test: mock pypandoc.convert_text when testing export views
Description
Resolves #1092 and #1113
Tasks
- [x] add
mocked_convert_text
fixture, which should be used in combination withexport_format
fixture, when testing export views - [x] add
mocked_convert_text
to all export view test functions - [x] remove special treatment of XML export (e.g.
assert root.tag == 'rdmo'
) - [x] add a new parametrized "unit test", that tests all export formats with one input, see https://github.com/rdmorganiser/rdmo/pull/1117#issuecomment-2285990209
- [x] test for invalid export format
- [x] assert status codes
- [x] assert Content-Type header
- [x] assert Content-Disposition header
- [ ] squash commits
Types of Changes
- [x] Refactoring (no functional changes, no api changes)
Checklist
- [x] I have read the contributor guide.
- [x] My code follows the code style of this project.