Test #4216
closedtest_crud_content_unit should test that content units cannot be deleted manually
Description
The tests that currently exist were based off of Pulp Issue 3418 [0], which said that content units that are present in a repository version should not be able to be deleted.
Shortly after that issue, another issue was created [1] which removed the ability to delete content units at all. After that issue was resolved, the proper (and only) way to do so from outside of a plugin is orphan cleanup.
In the following plugins, the test for 3418 [2] should be removed and replaced with a simpler test for 3445 that ensures that content units cannot be deleted, and that they raise an HTTP 405 "method not allowed" exception.
- Plugin Template
- File Plugin
- Python Plugin
- RPM Plugin
- Docker Plugin
- Ansible Plugin
Tangentially, it would be good to make all tests for unsupported HTTP methods (such as [3]) check for the specific HTTP 405 error code.
[0] https://pulp.plan.io/issues/3418
[1] https://pulp.plan.io/issues/3445
[2] https://github.com/pulp/plugin_template/blob/master/pulp_plugin_template/tests/functional/api/test_crud_content_unit.py#L108-L144
[3] https://github.com/pulp/plugin_template/blob/master/pulp_plugin_template/tests/functional/api/test_crud_content_unit.py#L85-L103
Related issues
Simplify content unit deletion test
For a brief period Pulp would allow you to delete a content unit as long as it wasn't used by a repository version. That is no longer the case - content unit deletion should be disallowed in all circumstances. Fix the tests likewise, and test that the response is HTTP 405 'method not allowed', specifically.
re #4216 https://pulp.plan.io/issues/4216