Skip to content

Commit

Permalink
[ADD] eater: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-champonnois committed Aug 3, 2023
1 parent bca5176 commit 3ae5b3a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions eater/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_eater
20 changes: 20 additions & 0 deletions eater/tests/test_eater.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase


class TestEater(TransactionCase):
def test_assign_parent_eater(self):
self.assertTrue(
self.env.ref("eater.eater2").write(
{"parent_eater_id": self.env.ref("eater.eater1")}
)
)

def test_eater_already_has_another_parent(self):
self.env.ref("eater.eater2").write(
{"parent_eater_id": self.env.ref("eater.eater1")}
)
with self.assertRaises(ValidationError):
self.env.ref("eater.eater2").write(
{"parent_eater_id": self.env.ref("eater.eater3")}
)

0 comments on commit 3ae5b3a

Please sign in to comment.