Skip to content

Commit

Permalink
Merge branch 'master' into set_tz
Browse files Browse the repository at this point in the history
  • Loading branch information
ericof committed Dec 6, 2019
2 parents 70b37e1 + f6a14f9 commit 899c096
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 61 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -6,6 +6,9 @@ There's a frood who really knows where his towel is.
2.13b4 (unreleased)
^^^^^^^^^^^^^^^^^^^

- Remove unused view `social_likes_view`.
[idgserpro]

- Explicity remove the viewlet for folder_contents view (closes `#261 <https://github.com/plonegovbr/brasil.gov.temas/issues/261>`_).
[rodfersou]

Expand Down
2 changes: 1 addition & 1 deletion buildout.cfg
Expand Up @@ -38,7 +38,7 @@ eggs = i18ndude

[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}
eggs = ${test:eggs}

[pylint]
recipe = zc.recipe.egg
Expand Down
9 changes: 0 additions & 9 deletions sc/social/like/browser/configure.zcml
Expand Up @@ -8,15 +8,6 @@

<browser:resourceDirectory name="sc.social.like" directory="static" />

<browser:page
for="*"
name="social_likes_view"
class=".socialikes.SocialLikes"
allowed_attributes="enabled"
layer="..interfaces.ISocialLikeLayer"
permission="zope2.View"
/>

<browser:page
for="*"
name="sl_helper"
Expand Down
23 changes: 0 additions & 23 deletions sc/social/like/browser/socialikes.py

This file was deleted.

28 changes: 0 additions & 28 deletions sc/social/like/tests/test_views.py
@@ -1,38 +1,10 @@
# -*- coding: utf-8 -*-
from plone import api
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from sc.social.like.browser.socialikes import SocialLikes
from sc.social.like.testing import INTEGRATION_TESTING

import unittest


class BrowserViewTestCase(unittest.TestCase):

layer = INTEGRATION_TESTING

def setUp(self):
self.portal = self.layer['portal']
self.request = self.layer['request']
setRoles(self.portal, TEST_USER_ID, ['Manager'])
self.portal.invokeFactory('Document', 'my-document')
self.document = self.portal['my-document']

def view(self, context=None):
context = context or self.portal
view = SocialLikes(context, self.request)
return view

def test_disabled_on_portal(self):
view = self.view(self.portal)
self.assertFalse(view.enabled)

def test_enabled_on_document(self):
view = self.view(self.document)
self.assertTrue(view.enabled)


class FallBackImageViewTestCase(unittest.TestCase):

layer = INTEGRATION_TESTING
Expand Down

0 comments on commit 899c096

Please sign in to comment.