fix flake

This commit is contained in:
Florent THOMAS 2022-02-10 08:31:25 +01:00
parent 6104844287
commit 741544cb8e
2 changed files with 5 additions and 5 deletions

View File

@ -119,7 +119,7 @@ class DocumentPage(models.Model):
child_ids = self
if vals.get("color", False) and len(vals) == 1:
child_ids = self.search(
[("type", "=", "category"),
[("type", "=", "category"),
("parent_id", "child_of", self.ids)]
)
res = super(DocumentPage, child_ids).write(vals)
@ -185,8 +185,8 @@ class DocumentPage(models.Model):
@api.multi
def _inverse_content(self):
for rec in self:
if rec.type == "content" and \
rec.content != rec.history_head.content:
if rec.type == "content" \
and rec.content != rec.history_head.content:
rec._create_history(
{
"name": rec.draft_name,

View File

@ -32,14 +32,14 @@ class TestDocumentPage(common.TransactionCase):
def test_page_history_diff(self):
page = self.page_obj.create({
"name": "Test Page 3",
"name": "Test Page 3",
"content": "Test content"})
page.content = "New content"
self.assertIsNotNone(page.history_ids[0].diff)
def test_page_link(self):
page = self.page_obj.create({
"name": "Test Page 3",
"name": "Test Page 3",
"content": "Test content"})
self.assertEqual(
page.backend_url,