-
-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
11.0 fix employee firstname test #427
11.0 fix employee firstname test #427
Conversation
@pedrobaeza Can i have some help please, i've pushed #406 into main branch( but by mistake i choose merge commits, not squash), and now the tests fail, but i don't get it why, on the PR everything was ok, all were green, but now, i really don't know why... |
Stange is that locally i don't have any error on tests, both modules...with Odoo latest revision.. |
e616d38
to
d8bb932
Compare
8d258d6
to
499a6f3
Compare
Update test. Update test. Update test. Update test.
1dc4faa
to
45f54dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could have also just explicitly called the decorated function - we're not testing if the framework works, but if the functions we use do what they should. But I think it's okay the way it is
@pedrobaeza @espo-tony Can i have your review here, since the module is merged and we have a bug, and other PR's are red without this.. |
@@ -46,12 +46,22 @@ def test_onchange(self): | |||
""" | |||
Validate the get_name method is not failing | |||
""" | |||
field_onchange = self.employee1_id._onchange_spec() | |||
field_onchange = self.employee_model._onchange_spec() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are running the onchange over an empty recordset, which is for sure invalid. If you want to set some kind of default, do it over a NewId
recordset (created with new()
method)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you are making some assert
after this call, so it's not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which line? Any way, what I'm proposing is
field_onchange = self.employee_model.new({})
field_onchange._onchange_spec()
self.assertEqual(field_onchange.get('firstname'), '1')
self.assertEqual(field_onchange.get('lastname'), '1')
It's for assuring no weird behavior is got over versions.
…rs_change_date_value_when_Payment_Execution_Date_Type_==_Fixed_Date [BIZ-1503][IMP] Set move date equal to Payment Execution when Payment…
No description provided.