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
Updated by dalley almost 6 years ago
- Related to Issue #3445: Remove the ability for users to delete a single content unit. added
Updated by dalley almost 6 years ago
- Status changed from NEW to POST
- Assignee set to dalley
Added by dalley almost 6 years ago
Updated by dalley almost 6 years ago
File PR https://github.com/pulp/pulp_file/pull/135
Plugin Template PR https://github.com/pulp/plugin_template/pull/17
RPM PR https://github.com/pulp/pulp_rpm/pull/1233
Updated by dalley almost 6 years ago
Added by dalley almost 6 years ago
Revision 4e136cc7 | View on GitHub
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.
Added by dalley almost 6 years ago
Revision 4322c927 | View on GitHub
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.
Added by dalley almost 6 years ago
Revision 1d84e96a | View on GitHub
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.
Added by dalley almost 6 years ago
Revision f592f249 | View on GitHub
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.
Added by dalley almost 6 years ago
Revision f592f249 | View on GitHub
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.
Added by dalley almost 6 years ago
Revision f592f249 | View on GitHub
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.
Added by dalley almost 6 years ago
Revision f592f249 | View on GitHub
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.
Updated by dalley almost 6 years ago
- Status changed from POST to CLOSED - COMPLETE
Added by dalley almost 6 years ago
Revision b712be75 | View on GitHub
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.
Updated by bmbouter over 5 years ago
- Project changed from 27 to Pulp
The plugin template Redmine project is being consolidated into the Pulp Redmine project so all issues are being moved over.
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