Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinVermeulen committed Oct 31, 2024
1 parent 0ce6b18 commit 9e042d0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion estate/tests/test_offers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from odoo.tests import tagged
from odoo.tests import tagged, Form
from .common import EstateTestCase
from odoo.exceptions import UserError

Expand Down Expand Up @@ -107,3 +107,18 @@ def test_sell_property(self):

with self.assertRaises(UserError):
self.property_new.action_property_sold()

def test_onChange_garden(self):
property_form = Form(self.env['estate.property'])
self.assertEqual(property_form.garden_area, 0)
self.assertEqual(property_form.garden_orientation, False)

property_form.garden = True
self.assertEqual(property_form.garden_area, 10)
self.assertEqual(property_form.garden_orientation, 'north')
self.assertEqual(property_form.total_area, property_form.living_area + property_form.garden_area)

property_form.garden = False
self.assertEqual(property_form.garden_area, 0)
self.assertEqual(property_form.garden_orientation, False)
self.assertEqual(property_form.total_area, property_form.living_area)

0 comments on commit 9e042d0

Please sign in to comment.