Skip to content

Commit

Permalink
Remove extra CATEGORIES in feed and add test for multiple categories. C…
Browse files Browse the repository at this point in the history
…loses #63.
  • Loading branch information
mjfinney authored and aleksihakli committed May 1, 2023
1 parent 3b129d2 commit ddffb5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion django_ical/feedgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 74,6 @@
("percent_complete", "percent-complete"),
("priority", "priority"),
("due", "due"),
("categories", "categories"),
)

class ICal20Feed(SyndicationFeed):
Expand Down
6 changes: 5 additions & 1 deletion django_ical/tests/test_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 97,7 @@ def items(self):
"email": "[email protected]",
"role": "CHAIR",
},
"categories": ['Cat1', 'Cat2'],
"alarms": [
{
"trigger": timedelta(minutes=-30),
Expand Down Expand Up @@ -376,6 377,9 @@ def test_items(self):
calendar.subcomponents[1]["ORGANIZER"].to_ical(),
b"MAILTO:[email protected]",
)
self.assertEqual(
calendar.subcomponents[1]["CATEGORIES"].to_ical(), b"Cat1,Cat2"
)
self.assertIn(
b"BEGIN:VALARM\r\nACTION:DISPLAY\r\nDESCRIPTION:Alarm2a\r\nTRIGGER:-PT30M\r\nEND:VALARM\r\n",
[comp.to_ical() for comp in calendar.subcomponents[1].subcomponents],
Expand Down Expand Up @@ -407,7 411,7 @@ def test_items(self):
calendar.subcomponents[2]["PRIORITY"].to_ical(), b"1"
)
self.assertEqual(
calendar.subcomponents[2]["CATEGORIES"][0].to_ical(), b"CLEANING"
calendar.subcomponents[2]["CATEGORIES"].to_ical(), b"CLEANING"
)
self.assertEqual(
calendar.subcomponents[2]["PERCENT-COMPLETE"].to_ical(), b"89"
Expand Down

0 comments on commit ddffb5d

Please sign in to comment.