Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed Dec 6, 2016
1 parent 4b278f7 commit 4aab386
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Expand Up @@ -6,7 +6,7 @@ There's a frood who really knows where his towel is.
1.3b2 (unreleased)
^^^^^^^^^^^^^^^^^^

- Use timestamp object instead of string of timestamp to represent image modified date (fixes `#686`_).
- Fix ``TypeError`` when changing default image scale on basic tiles (fixes `#686`_).
[rodfersou]

- Fixed adding a 'more' link in list tiles.
Expand Down
8 changes: 4 additions & 4 deletions src/collective/cover/tests/test_upgrades.py
Expand Up @@ -3,7 +3,6 @@
from collective.cover.config import IS_PLONE_5
from collective.cover.controlpanel import ICoverSettings
from collective.cover.testing import INTEGRATION_TESTING
from persistent.dict import PersistentDict
from persistent.mapping import PersistentMapping
from plone import api
from plone.registry.interfaces import IRegistry
Expand Down Expand Up @@ -590,8 +589,9 @@ def test_registrations(self):
self.assertGreaterEqual(int(version), int(self.to_version))
self.assertEqual(self._how_many_upgrades_to_do(), 2)

def test_fix_image_modified_date(self):
title = u'Update all tiles to fix modified date'
def test_fix_image_field_modification_time(self):
from persistent.dict import PersistentDict
title = u'Fix image field modification time'
step = self._get_upgrade_step(title)
assert step is not None

Expand All @@ -614,7 +614,7 @@ def test_fix_image_modified_date(self):
dmgr.annotations[dmgr.key] = PersistentDict(old_data)

data = dmgr.get()
self.assertIsInstance(data['image_mtime'], str)
assert isinstance(data['image_mtime'], str)

# run the upgrade step to validate the update
self._do_upgrade_step(step)
Expand Down
4 changes: 2 additions & 2 deletions src/collective/cover/upgrades/v15/__init__.py
Expand Up @@ -5,8 +5,8 @@
from plone.tiles.interfaces import ITileDataManager


def fix_image_modified_date(context):
"""Update all tiles to fix modified date"""
def fix_image_field_modification_time(context):
"""Fix image modification time to be float timestamp instead of string."""

covers = context.portal_catalog(portal_type='collective.cover.content')
logger.info('About to update {0} objects'.format(len(covers)))
Expand Down
6 changes: 3 additions & 3 deletions src/collective/cover/upgrades/v15/configure.zcml
Expand Up @@ -10,9 +10,9 @@
profile="collective.cover:default">

<genericsetup:upgradeStep
title="Update all tiles to fix modified date"
description="Modified date should be DateTime object instead of string of timestamp"
handler=".fix_image_modified_date"
title="Fix image field modification time"
description="Fix image modification time to be float timestamp instead of string."
handler=".fix_image_field_modification_time"
/>

<genericsetup:upgradeStep
Expand Down

0 comments on commit 4aab386

Please sign in to comment.