mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-29 20:06: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
|
child_ids = self
|
||||||
if vals.get("color", False) and len(vals) == 1:
|
if vals.get("color", False) and len(vals) == 1:
|
||||||
child_ids = self.search(
|
child_ids = self.search(
|
||||||
[("type", "=", "category"),
|
[("type", "=", "category"),
|
||||||
("parent_id", "child_of", self.ids)]
|
("parent_id", "child_of", self.ids)]
|
||||||
)
|
)
|
||||||
res = super(DocumentPage, child_ids).write(vals)
|
res = super(DocumentPage, child_ids).write(vals)
|
||||||
@ -185,8 +185,8 @@ class DocumentPage(models.Model):
|
|||||||
@api.multi
|
@api.multi
|
||||||
def _inverse_content(self):
|
def _inverse_content(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.type == "content" and \
|
if rec.type == "content" \
|
||||||
rec.content != rec.history_head.content:
|
and rec.content != rec.history_head.content:
|
||||||
rec._create_history(
|
rec._create_history(
|
||||||
{
|
{
|
||||||
"name": rec.draft_name,
|
"name": rec.draft_name,
|
||||||
|
@ -32,14 +32,14 @@ class TestDocumentPage(common.TransactionCase):
|
|||||||
|
|
||||||
def test_page_history_diff(self):
|
def test_page_history_diff(self):
|
||||||
page = self.page_obj.create({
|
page = self.page_obj.create({
|
||||||
"name": "Test Page 3",
|
"name": "Test Page 3",
|
||||||
"content": "Test content"})
|
"content": "Test content"})
|
||||||
page.content = "New content"
|
page.content = "New content"
|
||||||
self.assertIsNotNone(page.history_ids[0].diff)
|
self.assertIsNotNone(page.history_ids[0].diff)
|
||||||
|
|
||||||
def test_page_link(self):
|
def test_page_link(self):
|
||||||
page = self.page_obj.create({
|
page = self.page_obj.create({
|
||||||
"name": "Test Page 3",
|
"name": "Test Page 3",
|
||||||
"content": "Test content"})
|
"content": "Test content"})
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
page.backend_url,
|
page.backend_url,
|
||||||
|
Loading…
Reference in New Issue
Block a user