-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
246 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xml:lang="en" | ||
xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
metal:use-macro="context/main_template/macros/master" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
i18n:domain="collective.liveblog"> | ||
<head> | ||
<metal:block metal:fill-slot="top_slot" | ||
tal:define="dummy python:request.set('disable_border',1)" /> | ||
</head> | ||
<body> | ||
<metal:block fill-slot="main"> | ||
<article itemscope | ||
itemtype="http://schema.org/BlogPosting" | ||
tal:define="update view/update" | ||
tal:condition="update"> | ||
<header> | ||
<div tal:replace="structure provider:plone.abovecontenttitle" /> | ||
<h1 class="documentFirstHeading" | ||
itemprop="headline" | ||
tal:content="update/title" | ||
tal:condition="update/title"> | ||
Title | ||
</h1> | ||
<div class="documentByLine"> | ||
<tal:byline condition="view/show_byline"> | ||
<span i18n:translate="label_by_author"> | ||
by | ||
<span itemprop="author" | ||
tal:content="update/creator" | ||
i18n:name="byline" /> | ||
</span> | ||
— | ||
<tal:mod i18n:translate="box_last_modified"> | ||
last modified | ||
</tal:mod> | ||
<span tal:replace="update/datetime"> | ||
August 16, 2001 at 23:35:59 | ||
</span> | ||
</tal:byline> | ||
</div> | ||
</header> | ||
<div tal:replace="structure provider:plone.abovecontentbody" /> | ||
<div id="content-core" | ||
itemprop="articleBody"> | ||
<section id="micro-updates"> | ||
<article class="microupdate" | ||
data-timestamp="" | ||
itemprop="comment" | ||
itemscope | ||
itemtype="http://schema.org/Comment" | ||
tal:condition="update" | ||
tal:attributes="data-timestamp update/timestamp"> | ||
<div class="microupdate-text" | ||
itemprop="text" | ||
tal:content="structure update/text" /> | ||
</article> | ||
</section> | ||
</div> | ||
<div tal:replace="structure provider:plone.belowcontentbody" /> | ||
<div class="back"><span i18n:translate="" | ||
tal:omit-tag="">Extracted from:</span> <a tal:attributes="href context/absolute_url" | ||
tal:content="context/Title" /></div> | ||
</article> | ||
</metal:block> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
from collective.liveblog.testing import INTEGRATION_TESTING | ||
|
||
import unittest | ||
|
||
|
||
class UpgradeTestCaseBase(unittest.TestCase): | ||
|
||
layer = INTEGRATION_TESTING | ||
|
||
def setUp(self, from_version, to_version): | ||
self.portal = self.layer['portal'] | ||
self.setup = self.portal['portal_setup'] | ||
self.profile_id = u'collective.liveblog:default' | ||
self.from_version = from_version | ||
self.to_version = to_version | ||
|
||
def get_upgrade_step(self, title): | ||
"""Get the named upgrade step.""" | ||
self.setup.setLastVersionForProfile(self.profile_id, self.from_version) | ||
upgrades = self.setup.listUpgrades(self.profile_id) | ||
steps = [s for s in upgrades[0] if s['title'] == title] | ||
return steps[0] if steps else None | ||
|
||
def execute_upgrade_step(self, step): | ||
"""Execute an upgrade step.""" | ||
request = self.layer['request'] | ||
request.form['profile_id'] = self.profile_id | ||
request.form['upgrades'] = [step['id']] | ||
self.setup.manage_doUpgrades(request=request) | ||
|
||
@property | ||
def total_steps(self): | ||
"""Return the number of steps in the upgrade.""" | ||
self.setup.setLastVersionForProfile(self.profile_id, self.from_version) | ||
upgrades = self.setup.listUpgrades(self.profile_id) | ||
assert len(upgrades) > 0 | ||
return len(upgrades[0]) | ||
|
||
|
||
class Upgrade1000to1001TestCase(UpgradeTestCaseBase): | ||
|
||
def setUp(self): | ||
UpgradeTestCaseBase.setUp(self, u'1000', u'1001') | ||
|
||
def test_upgrade_to_1001_registrations(self): | ||
version = self.setup.getLastVersionForProfile(self.profile_id)[0] | ||
self.assertTrue(int(version) >= int(self.to_version)) | ||
self.assertEqual(self.total_steps, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding:utf-8 -*- | ||
from plone import api | ||
from collective.liveblog.config import PROJECTNAME | ||
|
||
import logging | ||
|
||
logger = logging.getLogger(PROJECTNAME) | ||
|
||
|
||
def cook_css_resources(context): | ||
"""Cook css resources.""" | ||
css_tool = api.portal.get_tool('portal_css') | ||
css_tool.cookResources() | ||
logger.info('CSS resources were cooked') | ||
|
||
|
||
def cook_javascript_resources(context): | ||
"""Cook javascript resources.""" | ||
js_tool = api.portal.get_tool('portal_javascripts') | ||
js_tool.cookResources() | ||
logger.info('Javascript resources were cooked') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
i18n_domain="collective.liveblog"> | ||
|
||
<!-- Include Upgrades --> | ||
<include package=".v1001" /> | ||
|
||
</configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# -*- coding:utf-8 -*- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:gs="http://namespaces.zope.org/genericsetup" | ||
i18n_domain="collective.liveblog"> | ||
|
||
<gs:upgradeSteps | ||
source="1000" | ||
destination="1001" | ||
profile="collective.liveblog:default"> | ||
|
||
<gs:upgradeStep | ||
title="Cook CSS resources" | ||
description="There were changes in the CSS files, so we need to cook the resources." | ||
handler="..cook_css_resources" | ||
/> | ||
|
||
</gs:upgradeSteps> | ||
|
||
</configure> |