@@ -190,4 +190,33 @@ def test_serialize(unrestricted_timetable: Timetable):
190
190
"2021-10-09T00:00:00+00:00" ,
191
191
],
192
192
"restrict_to_events" : False ,
193
+ "_summary" : "6 events" ,
194
+ "description" : "6 events between 2021-09-06T00:00:00+00:00 and 2021-10-09T00:00:00+00:00" ,
193
195
}
196
+
197
+
198
+ def test_timetable_after_serialization_is_the_same ():
199
+ description = "Example description"
200
+ timetable = EventsTimetable (
201
+ event_dates = EVENT_DATES , restrict_to_events = True , description = description , presorted = True
202
+ )
203
+ assert timetable .summary == description
204
+ assert timetable .description == description
205
+ assert timetable .event_dates == EVENT_DATES
206
+
207
+ deserialized : EventsTimetable = timetable .deserialize (timetable .serialize ())
208
+ assert deserialized .summary == description
209
+ assert deserialized .description == description
210
+ assert deserialized .event_dates == EVENT_DATES
211
+
212
+
213
+ def test_timetable_without_description_after_serialization_is_the_same ():
214
+ timetable = EventsTimetable (event_dates = EVENT_DATES , presorted = True )
215
+ summary = f"{ timetable .summary } "
216
+ description = f"{ timetable .description } "
217
+ assert timetable .event_dates == EVENT_DATES
218
+
219
+ deserialized : EventsTimetable = timetable .deserialize (timetable .serialize ())
220
+ assert deserialized .summary == summary
221
+ assert deserialized .description == description
222
+ assert deserialized .event_dates == EVENT_DATES
0 commit comments