mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-29 03:46:29 -06:00
fix flake
This commit is contained in:
parent
6104844287
commit
741544cb8e
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user