Skip to content

Commit

Permalink
[#3644] Fix activity test to use utcnow
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 27, 2017
1 parent c636752 commit ca9eefb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckan/tests/logic/action/test_update.py
Expand Up @@ -247,7 +247,7 @@ def test_user_update_activity_stream(self):
'''Test that the right activity is emitted when updating a user.'''

user = factories.User()
before = datetime.datetime.now()
before = datetime.datetime.utcnow()

# FIXME we have to pass the email address and password to user_update
# even though we're not updating those fields, otherwise validation
Expand All @@ -264,7 +264,7 @@ def test_user_update_activity_stream(self):
assert latest_activity['activity_type'] == 'changed user'
assert latest_activity['object_id'] == user['id']
assert latest_activity['user_id'] == user['id']
after = datetime.datetime.now()
after = datetime.datetime.utcnow()
timestamp = datetime_from_string(latest_activity['timestamp'])
assert timestamp >= before and timestamp <= after

Expand Down

0 comments on commit ca9eefb

Please sign in to comment.