def test_update_comments_viewed_timestamp_none(self): user = UserFactory() user.comments_viewed_timestamp = {} user.save() update_comments_viewed_timestamp() user.reload() assert_equal(user.comments_viewed_timestamp, {})
def test_update_comments_viewed_timestamp(self): user = UserFactory() timestamp = datetime.utcnow().replace(microsecond=0) user.comments_viewed_timestamp = {'abc123': timestamp} user.save() update_comments_viewed_timestamp() user.reload() assert_equal(user.comments_viewed_timestamp, {'abc123': {'node': timestamp}})
def test_update_comments_viewed_timestamp(self): user = UserFactory() timestamp = datetime.utcnow().replace(microsecond=0) user.comments_viewed_timestamp = {'abc123': timestamp} user.save() update_comments_viewed_timestamp() user.reload() assert_equal(user.comments_viewed_timestamp, {'abc123': { 'node': timestamp }})
def test_update_comments_viewed_timestamp(self): user = UserFactory() timestamp = timezone.now().replace(microsecond=0) user.comments_viewed_timestamp = { 'node_id': { 'node': timestamp, 'files': { 'file_id_1': timestamp, 'file_id_2': timestamp, } } } user.save() update_comments_viewed_timestamp() user.reload() assert_equal(user.comments_viewed_timestamp, { 'node_id': timestamp, 'file_id_1': timestamp, 'file_id_2': timestamp })