Skip to content

Commit

Permalink
Fix code analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed Aug 1, 2016
1 parent 41e9033 commit f98fcbf
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
12 changes: 12 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ Changelog
1.0.5 (unreleased)
------------------

- Fix imports to follow conventions.
[hvelarde]

- Avoid usage of double quotes on strings.
[hvelarde]

- Avoid usage of invokeFactory.
[hvelarde]

- Remove dependency on unittest2 as package is not intended to be compatible with Python 2.6.
[hvelarde]

- Use selenium v2.53.6.
[hvelarde]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class I{{{ package.browserlayer }}}(IDefaultBrowserLayer):
class I{{{ package.dexterity_type_name }}}(Interface):

title = schema.TextLine(
title=_(u"Title"),
title=_(u'Title'),
required=True,
)

description = schema.Text(
title=_(u"Description"),
title=_(u'Description'),
required=False,
)
{{% endif %}}
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-
from plone.app.testing import TEST_USER_ID
from zope.component import queryUtility
from zope.component import createObject
from plone import api
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.dexterity.interfaces import IDexterityFTI
from plone import api

from {{{ package.dottedname }}}.testing import {{{package.uppercasename}}}_INTEGRATION_TESTING # noqa
from {{{ package.dottedname }}}.interfaces import I{{{ package.dexterity_type_name }}}
from {{{ package.dottedname }}}.testing import {{{package.uppercasename}}}_INTEGRATION_TESTING # noqa
from zope.component import createObject
from zope.component import queryUtility

import unittest2 as unittest
import unittest


class {{{ package.dexterity_type_name }}}IntegrationTest(unittest.TestCase):
Expand Down Expand Up @@ -38,7 +37,9 @@ class {{{ package.dexterity_type_name }}}IntegrationTest(unittest.TestCase):
self.assertTrue(I{{{ package.dexterity_type_name }}}.providedBy(obj))

def test_adding(self):
self.portal.invokeFactory('{{{ package.dexterity_type_name }}}', '{{{ package.dexterity_type_name }}}')
self.assertTrue(
I{{{ package.dexterity_type_name }}}.providedBy(self.portal['{{{ package.dexterity_type_name }}}'])
obj = api.content.create(
container=self.portal,
type='{{{ package.dexterity_type_name }}}',
id='{{{ package.dexterity_type_name }}}',
)
self.assertTrue(I{{{ package.dexterity_type_name }}}.providedBy(obj))
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from {{{ package.dottedname }}}.testing import {{{package.uppercasename}}}_ACCEPTANCE_TESTING # noqa
from plone.app.testing import ROBOT_TEST_LEVEL
from plone.testing import layered
from {{{ package.dottedname }}}.testing import {{{package.uppercasename}}}_ACCEPTANCE_TESTING # noqa

import os
import robotsuite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Setup tests for this package."""
from {{{ package.dottedname }}}.testing import {{{package.uppercasename}}}_INTEGRATION_TESTING # noqa
from plone import api
from {{{ package.dottedname }}}.testing import {{{package.uppercasename}}}_INTEGRATION_TESTING # noqa

import unittest

Expand Down

0 comments on commit f98fcbf

Please sign in to comment.