Project

Profile

Help

Test #4216

closed

test_crud_content_unit should test that content units cannot be deleted manually

Added by dalley about 6 years ago. Updated over 5 years ago.

Status:
CLOSED - COMPLETE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Version:
Platform Release:
Tags:
Plugin Template
Sprint:
Quarter:

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

Related to Pulp - Issue #3445: Remove the ability for users to delete a single content unit.CLOSED - CURRENTRELEASEdalleyActions

Also available in: Atom PDF