#NEWLINE# def test_complex_rule_serialization( ) : #NEWLINE# #INDENT# rule = Rule ( recurrence . WEEKLY , interval = 17 , wkst = 1 , count = 7 , byday = [ recurrence . to_weekday ( '-1MO' ) , recurrence . to_weekday ( 'TU' ) ] , bymonth = [ 1 , 3 ] ) #NEWLINE# serialized = recurrence . serialize ( rule ) #NEWLINE# assert ( 'RRULE:FREQ=WEEKLY;INTERVAL=17;WKST=TU;COUNT=7;BYDAY=-1MO,TU;BYMONTH=1,3' == serialized ) #NEWLINE# assert ( recurrence . deserialize ( serialized ) == Recurrence ( rrules = [ rule ] ) )