Skip to content

Commit

Permalink
test: add test for str datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Oct 27, 2023
1 parent 3bd8c8c commit f4b4d42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eventtracking/backends/tests/test_event_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from eventtracking.backends.event_bus import EventBusRoutingBackend

from datetime import datetime

class TestAsyncRoutingBackend(TestCase):
"""
Expand Down Expand Up @@ -51,7 +52,7 @@ def test_successful_send_event(self, mock_get_producer):
"event_data": {
"tracking_log": TrackingLogData(
name=self.sample_event["name"],
timestamp=self.sample_event["timestamp"],
timestamp=datetime.strptime(self.sample_event["timestamp"], "%Y-%m-%dT%H:%M:%S.%f%z"),
data=json.dumps(self.sample_event["data"]),
context=json.dumps(self.sample_event["context"]),
)
Expand Down

0 comments on commit f4b4d42

Please sign in to comment.