Skip to content

Commit e58a4dc

Browse files
committed
Fixed tests for Plone 4.3
1 parent 829e4b2 commit e58a4dc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

quintagroup/seoptimizer/tests/testCanonicalURL.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ def afterSetUp(self):
2424
def test_NoCanonicalURL(self):
2525
html = self.publish(self.mydoc_path, self.basic_auth).getBody()
2626
foundcurls = self.curl.findall(html)
27-
assert not self.mydoc.hasProperty(CANONICAL_PROPERTY)
28-
self.assertTrue(not foundcurls, "CANONICAL URL found, "
29-
"but object hasn't '%s' property" % CANONICAL_PROPERTY)
27+
try:
28+
from plone.app.layout.links.viewlets import CanonicalURL
29+
except ImportError:
30+
assert not self.mydoc.hasProperty(CANONICAL_PROPERTY)
31+
self.assertTrue(not foundcurls, "CANONICAL URL found, but object "
32+
"hasn't '%s' property" % CANONICAL_PROPERTY)
3033

3134
def test_CanonicalProperty(self):
3235
self.assertTrue(not self.mydoc.hasProperty(CANONICAL_PROPERTY),

0 commit comments

Comments
 (0)