diff --git a/addons/itsulu_blog_publisher/tests/test_blog_post_social.py b/addons/itsulu_blog_publisher/tests/test_blog_post_social.py index 5797aae..3ab435c 100644 --- a/addons/itsulu_blog_publisher/tests/test_blog_post_social.py +++ b/addons/itsulu_blog_publisher/tests/test_blog_post_social.py @@ -254,10 +254,10 @@ class TestNotificationEmail(TransactionCase): # ACT — render the template synchronously to check the subject template = self.env.ref('itsulu_blog_publisher.email_template_blog_published') - rendered = template.generate_email(log.id, fields=['subject']) + rendered = template.generate_email([log.id], fields=['subject']) # ASSERT - subject = rendered.get('subject', '') + subject = rendered[log.id].get('subject', '') self.assertTrue(subject, "Rendered email subject must be non-empty") self.assertIn('[ITSulu Insights] Blog Post Published:', subject, f"Unexpected subject: {subject}") @@ -300,8 +300,8 @@ class TestNotificationEmail(TransactionCase): # Verify template renders all platform copy in the body template = self.env.ref('itsulu_blog_publisher.email_template_blog_published') - rendered = template.generate_email(log.id, fields=['body_html']) - body = rendered.get('body_html', '') + rendered = template.generate_email([log.id], fields=['body_html']) + body = rendered[log.id].get('body_html', '') self.assertIn('Twitter A copy', body, "Body must contain Twitter copy") self.assertIn('LinkedIn copy', body, "Body must contain LinkedIn copy") @@ -319,8 +319,8 @@ class TestNotificationEmail(TransactionCase): # ASSERT — render the template synchronously to check the URL appears in the body template = self.env.ref('itsulu_blog_publisher.email_template_blog_published') - rendered = template.generate_email(log.id, fields=['body_html']) - body = rendered.get('body_html', '') + rendered = template.generate_email([log.id], fields=['body_html']) + body = rendered[log.id].get('body_html', '') self.assertIn('itsulu.com', body, "Body must contain itsulu.com URL") def test_notification_email_is_not_sent_for_draft_posts(self): diff --git a/conftest.py b/conftest.py index 9d18efc..953079b 100644 --- a/conftest.py +++ b/conftest.py @@ -8,9 +8,9 @@ import pytest @pytest.fixture -def odoo_env(env): +def odoo_env(request): """Re-export pytest-odoo's env fixture for use in pytest-bdd step definitions.""" - return env + return request.getfixturevalue('env') print(">>> conftest.py loaded", file=sys.stderr)