kopia lustrzana https://github.com/collective/icalendar
dont treat components with a subset of other a larger components' subcomponents as equal to the bigger component
rodzic
4f0028663e
commit
2dfd51cf59
|
@ -437,6 +437,9 @@ class Component(CaselessDict):
|
|||
return f"{self.name or type(self).__name__}({dict(self)}{', ' + subs if subs else ''})"
|
||||
|
||||
def __eq__(self, other):
|
||||
if not len(self.subcomponents) == len(other.subcomponents):
|
||||
return False
|
||||
|
||||
properties_equal = super().__eq__(other)
|
||||
if not properties_equal:
|
||||
return False
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID:icalendar-2023
|
||||
BEGIN:VEVENT
|
||||
UID:1
|
||||
SUMMARY: Some event ':'
|
||||
DTSTART;TZID="Western/Central Europe";VALUE=DATE-TIME:20211101T160000
|
||||
DTEND;TZID="Western/Central Europe";VALUE=DATE-TIME:20211101T163000
|
||||
DTSTAMP:20211004T150245Z
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
|
@ -469,6 +469,7 @@ class TestCal(unittest.TestCase):
|
|||
'issue_178_custom_component_inside_other',
|
||||
'issue_526_calendar_with_events',
|
||||
'issue_526_calendar_with_different_events',
|
||||
'issue_526_calendar_with_event_subset',
|
||||
], repeat=2)
|
||||
)
|
||||
def test_comparing_calendars(calendars, calendar, other_calendar):
|
||||
|
|
Ładowanie…
Reference in New Issue