fix: use sudo() in blog_post factory to bypass validation

The blog.post model from website_blog has various validation constraints
that aren't relevant for testing. Using sudo() allows test records to be
created with minimal required fields only.
This commit is contained in:
Nicholas Riegel 2026-05-29 23:25:17 -04:00
parent f246f2deae
commit fb89605191

View file

@ -44,7 +44,8 @@ class BlogPublisherFactory:
'website_meta_keywords': '',
}
defaults.update(kw)
return self.env['blog.post'].create(defaults)
# Use sudo() to bypass any validation that might fail in tests
return self.env['blog.post'].sudo().create(defaults)
# ------------------------------------------------------------------ #
# itsulu_blog_publisher models #