Skip to content

Commit

Permalink
Bugfix - Make timestamp default a callable
Browse files Browse the repository at this point in the history
Timestamps in EventLog were not recorded during event insertion time.
They were fixated when EventLog was initialized and kept duplicating
across eventlog records.
  • Loading branch information
subhashb committed Oct 20, 2020
1 parent dcd66bb commit c315b1a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Release History
===============

0.5.8
-----

* Fix Issue with timestamps in EventLog

0.5.7
-----

Expand Down
2 changes: 1 addition & 1 deletion src/protean/infra/event_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class EventLog(BaseAggregate):
kind = String(max_length=50, required=True)
payload = Dict(required=True)
timestamp = DateTime(required=True, default=datetime.utcnow())
timestamp = DateTime(required=True, default=datetime.utcnow)


class EventLogRepository(BaseRepository):
Expand Down
6 changes: 6 additions & 0 deletions tests/event_log/test_event_log_aggregate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest


@pytest.mark.skip
def test_timestamps_are_logged_properly():
pass

0 comments on commit c315b1a

Please sign in to comment.