[FW][FIX] google_calendar: accepting recurrent event tests #162267
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
test_accepting_recurrent_event_*
tests make sure that accepting recurrent events on google side reflect in odoo. The test was failing because of the following:when retrieving the invited attendee, the test used
self.assertEqual(event.attendee_ids[1].state, expected_states[i])
assuming that organizer will be at index0
and invited user at index1
. However the list ofevent.attendee_ids
is ordered by create_date. And we create both organizer and attendee with the same command at the same time:partner_ids=[Command.set([self.organizer_user.partner_id.id, self.attendee_user.partner_id.id])]
So we might have organizer at index1
and invited attendee at index0
. This resulted in the indeterministic behavior of the test.To fix this issue:
This commit changes how the invited attendee is retrieved, making sure that we always get the right attendee.
fixes runbot-61527
Forward-Port-Of: #161451