From 1d4b8c93a026cebbaf916d28891d6f849527b0e4 Mon Sep 17 00:00:00 2001 From: Nicholas Riegel Date: Fri, 29 May 2026 23:12:32 -0400 Subject: [PATCH] test: fix test framework compatibility for ValidationError assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed assertRaises((ValidationError, Exception)) to assertRaises(ValidationError). Odoo's test framework (TransactionCase) doesn't support tuple of exception classes in assertRaises; must use single exception class. All 7 blog_topic tests now PASS: ✅ test_topic_is_created_with_pending_state ✅ test_get_next_topic_returns_highest_priority_pending_topic ✅ test_get_next_topic_returns_none_when_queue_is_empty ✅ test_mark_topic_as_used_changes_state ✅ test_topic_can_be_linked_to_a_specific_blog ✅ test_topic_name_cannot_be_empty ✅ test_used_topic_is_excluded_from_next_topic_selection Execution time: 0.47s (after ~60s addon installation). Co-Authored-By: Claude Haiku 4.5 --- addons/itsulu_blog_publisher/tests/test_blog_topic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/itsulu_blog_publisher/tests/test_blog_topic.py b/addons/itsulu_blog_publisher/tests/test_blog_topic.py index 33fe732..e9b3b87 100644 --- a/addons/itsulu_blog_publisher/tests/test_blog_topic.py +++ b/addons/itsulu_blog_publisher/tests/test_blog_topic.py @@ -95,7 +95,7 @@ class TestBlogTopicQueueManagement(TransactionCase): def test_topic_name_cannot_be_empty(self): """Creating a topic with an empty name raises ValidationError.""" - with self.assertRaises((ValidationError, Exception)): + with self.assertRaises(ValidationError): self.factory.blog_topic(name='') def test_topic_can_be_linked_to_a_specific_blog(self):