From c8e91bb2849e7cca299143b238bee6373b109368 Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Thu, 22 Aug 2024 11:23:42 -0300 Subject: [PATCH] Add basic auth to content removal test We were getting failed tests on ContentUnitRemoveTestCase because the delete was being made by the requests library client without any any credentials. Then, we would get 403 (forbidden) instead of 405 (method now allowed). This assumes the delete requires auth in the first place. [noissue] --- pulp_rpm/tests/functional/api/test_crud_content_unit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pulp_rpm/tests/functional/api/test_crud_content_unit.py b/pulp_rpm/tests/functional/api/test_crud_content_unit.py index 5a2e1a779..d6d44b7c8 100644 --- a/pulp_rpm/tests/functional/api/test_crud_content_unit.py +++ b/pulp_rpm/tests/functional/api/test_crud_content_unit.py @@ -173,9 +173,10 @@ def do_test_remove_unit(self, remote_url): repo_content = get_content(repo.to_dict()) base_addr = self.cfg.get_host_settings()[0]["url"] + basic_auth = requests.auth.HTTPBasicAuth("admin", "password") for content_type in repo_content.keys(): response = requests.delete( - urljoin(base_addr, repo_content[content_type][0]["pulp_href"]) + urljoin(base_addr, repo_content[content_type][0]["pulp_href"]), auth=basic_auth ) self.assertEqual(response.status_code, 405)