Fix recurrence IDs after THISANDFUTURE overrides - #285
bensynapse wants to merge 2 commits into
Conversation
niccokunzmann
left a comment
There was a problem hiding this comment.
Thanks! This is good work!
I like the thoroughness of the tests.
Could you have a look at the suggestions?
| def test_edit_one_event_after_range_move(tzp): | ||
| """An exported occurrence can be edited without moving the whole range.""" | ||
| tzp() | ||
| calendar = Calendar.from_ical("""BEGIN:VCALENDAR |
There was a problem hiding this comment.
Could you move this into the calendars directory and use the calendars feature?
| ) | ||
| assert recurrence_ids == expected | ||
| for expanded in events: | ||
| if expanded["DTSTART"].dt != start: |
There was a problem hiding this comment.
Since you move it two days back in one case, you should get a duplication here.
Does this work?
| if expanded["DTSTART"].dt != start: | |
| if expanded["RECURRENCE-ID"].dt != start: |
| assert ( | ||
| "RANGE" in expanded["RECURRENCE-ID"].params | ||
| ) == keep_recurrence_attributes | ||
| assert calendar.to_ical() == original |
There was a problem hiding this comment.
| assert calendar.to_ical() == original | |
| assert calendar.to_ical() == original, "Recurrence calculation must not change the calendar" |
Is that the intention? Nice idea!
|
Pushed 486b398. The calendars now use fixtures from the calendars directory. |
I run Live Tennis API.
Expanded instances of a moved range currently reuse the override's
RECURRENCE-ID. Editing one can replace the wrong occurrence.Each result now identifies its original scheduled date.
RANGEis omitted by default and retained withkeep_recurrence_attributes=True. The source calendar stays unchanged.Fixes #222.
tox -e py38,py314 -- -q --tb=shortpasses 3,497 tests on each Python version, with six existing skips. The regressions cover dates, floating times, UTC and Berlin across daylight saving changes. They also check editing one occurrence after a range move. Both failures were reproduced on unchanged upstream.tox -e buildpasses. The configured pre-commit hooks pass on the changed files. Running them across the repository finds the same threedocs/conf.pydiagnostics on both branches:INP001,DTZ011andA001.tox -e docsexits 0 on both branches. Both report the same two indentation errors and one warning from thetyping.Tupledocstring.