diff options
-rw-r--r-- | tests/core/test_ld.py | 28 | ||||
-rw-r--r-- | users/models/inbox_message.py | 6 |
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/core/test_ld.py b/tests/core/test_ld.py new file mode 100644 index 0000000..bb465e1 --- /dev/null +++ b/tests/core/test_ld.py @@ -0,0 +1,28 @@ +import datetime + +from core.ld import parse_ld_date + + +def test_parse_ld_date(): + """ + Tests that the various kinds of LD dates that we see will work + """ + assert parse_ld_date("2022-11-16T15:57:58Z") == datetime.datetime( + 2022, + 11, + 16, + 15, + 57, + 58, + tzinfo=datetime.timezone.utc, + ) + + assert parse_ld_date("2022-11-16T15:57:58.123Z") == datetime.datetime( + 2022, + 11, + 16, + 15, + 57, + 58, + tzinfo=datetime.timezone.utc, + ) diff --git a/users/models/inbox_message.py b/users/models/inbox_message.py index 079c572..0bf6851 100644 --- a/users/models/inbox_message.py +++ b/users/models/inbox_message.py @@ -79,6 +79,12 @@ class InboxMessageStates(StateGraph): raise ValueError( f"Cannot handle activity of type delete.{unknown}" ) + case "add": + # We are ignoring these right now (probably pinned items) + pass + case "remove": + # We are ignoring these right now (probably pinned items) + pass case unknown: raise ValueError(f"Cannot handle activity of type {unknown}") return cls.processed |