mirror of
https://gitlab.com/itsulu-odoo/itsulu-blog-publisher.git
synced 2026-05-30 23:41:23 +00:00
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:
parent
f246f2deae
commit
fb89605191
1 changed files with 2 additions and 1 deletions
|
|
@ -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 #
|
||||
|
|
|
|||
Loading…
Reference in a new issue