This is an automated email from the ASF dual-hosted git repository. vavila pushed a commit to branch chore/change-tag-test-logic in repository https://gitbox.apache.org/repos/asf/superset.git
commit 81401d0561f388edbf8734a521e23cf7bd7160dc Author: Vitor Avila <[email protected]> AuthorDate: Mon Jan 13 15:29:44 2025 -0300 chore(tests): Changing the logic for an intermittent tag test --- tests/integration_tests/tags/api_tests.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/integration_tests/tags/api_tests.py b/tests/integration_tests/tags/api_tests.py index c9a718f60d..79022d2805 100644 --- a/tests/integration_tests/tags/api_tests.py +++ b/tests/integration_tests/tags/api_tests.py @@ -487,8 +487,19 @@ class TestTagApi(SupersetTestCase): @pytest.mark.usefixtures("create_tags") def test_delete_favorite_tag_not_found(self): + """ + Tag API: Test trying to remove an unexisting tag from the list + of user favorites returns 404. + """ self.login(ADMIN_USERNAME) - uri = "api/v1/tag/123/favorites/" # noqa: F541 + + # Fetch all existing tag IDs + existing_ids = [tag_id for (tag_id,) in db.session.query(Tag.id).all()] + + # Get an ID not in use + non_existent_id = max(existing_ids, default=0) + 1 + + uri = f"api/v1/tag/{non_existent_id}/favorites/" # noqa: F541 rv = self.client.delete(uri, follow_redirects=True) assert rv.status_code == 404
