diff --git a/setup.py b/setup.py index 1d7bf5a..d726d67 100644 --- a/setup.py +++ b/setup.py @@ -54,6 +54,7 @@ install_requires=[ "Plone", "setuptools", + "plone.api", "plone.distribution", "codesyntax.login", "collective.easyform", @@ -68,12 +69,6 @@ extras_require={ "test": [ "plone.app.testing", - # Plone KGS does not use this version, because it would break - # Remove if your package shall be part of coredev. - # plone_coredev tests as of 2016-04-01. - "plone.testing>=5.0.0", - "plone.app.contenttypes", - "plone.app.robotframework[debug]", ], }, entry_points=""" diff --git a/src/codesyntax/distributions/tests/robot/test_example.robot b/src/codesyntax/distributions/tests/robot/test_example.robot deleted file mode 100644 index daf9036..0000000 --- a/src/codesyntax/distributions/tests/robot/test_example.robot +++ /dev/null @@ -1,66 +0,0 @@ -# ============================================================================ -# EXAMPLE ROBOT TESTS -# ============================================================================ -# -# Run this robot test stand-alone: -# -# $ bin/test -s codesyntax.distributions -t test_example.robot --all -# -# Run this robot test with robot server (which is faster): -# -# 1) Start robot server: -# -# $ bin/robot-server --reload-path src codesyntax.distributions.testing.CODESYNTAX_DISTRIBUTIONS_ACCEPTANCE_TESTING -# -# 2) Run robot tests: -# -# $ bin/robot src/codesyntax/distributions/tests/robot/test_example.robot -# -# See the http://docs.plone.org for further details (search for robot -# framework). -# -# ============================================================================ - -*** Settings ***************************************************************** - -Resource plone/app/robotframework/selenium.robot -Resource plone/app/robotframework/keywords.robot - -Library Remote ${PLONE_URL}/RobotRemote - -Test Setup Open test browser -Test Teardown Close all browsers - - -*** Test Cases *************************************************************** - -Scenario: As a member I want to be able to log into the website - [Documentation] Example of a BDD-style (Behavior-driven development) test. - Given a login form - When I enter valid credentials - Then I am logged in - - -*** Keywords ***************************************************************** - -# --- Given ------------------------------------------------------------------ - -a login form - Go To ${PLONE_URL}/login_form - Wait until page contains Login Name - Wait until page contains Password - - -# --- WHEN ------------------------------------------------------------------- - -I enter valid credentials - Input Text __ac_name admin - Input Text __ac_password secret - Click Button Log in - - -# --- THEN ------------------------------------------------------------------- - -I am logged in - Wait until page contains You are now logged in - Page should contain You are now logged in diff --git a/src/codesyntax/distributions/tests/test_robot.py b/src/codesyntax/distributions/tests/test_robot.py deleted file mode 100644 index a834461..0000000 --- a/src/codesyntax/distributions/tests/test_robot.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -from codesyntax.distributions.testing import ( - CODESYNTAX_DISTRIBUTIONS_ACCEPTANCE_TESTING, -) # noqa: E501 -from plone.app.testing import ROBOT_TEST_LEVEL -from plone.testing import layered - -import os -import robotsuite -import unittest - - -def test_suite(): - suite = unittest.TestSuite() - current_dir = os.path.abspath(os.path.dirname(__file__)) - robot_dir = os.path.join(current_dir, "robot") - robot_tests = [ - os.path.join("robot", doc) - for doc in os.listdir(robot_dir) - if doc.endswith(".robot") and doc.startswith("test_") - ] - for robot_test in robot_tests: - robottestsuite = robotsuite.RobotTestSuite(robot_test) - robottestsuite.level = ROBOT_TEST_LEVEL - suite.addTests( - [ - layered( - robottestsuite, - layer=CODESYNTAX_DISTRIBUTIONS_ACCEPTANCE_TESTING, - ), - ] - ) - return suite diff --git a/src/codesyntax/distributions/tests/test_setup.py b/src/codesyntax/distributions/tests/test_setup.py deleted file mode 100644 index 5346bdb..0000000 --- a/src/codesyntax/distributions/tests/test_setup.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -"""Setup tests for this package.""" -from plone import api -from plone.app.testing import setRoles -from plone.app.testing import TEST_USER_ID -from codesyntax.distributions.testing import ( - CODESYNTAX_DISTRIBUTIONS_INTEGRATION_TESTING, -) # noqa: E501 - -import unittest - - -try: - from Products.CMFPlone.utils import get_installer -except ImportError: - get_installer = None - - -class TestSetup(unittest.TestCase): - """Test that codesyntax.distributions is properly installed.""" - - layer = CODESYNTAX_DISTRIBUTIONS_INTEGRATION_TESTING - - def setUp(self): - """Custom shared utility setup for tests.""" - self.portal = self.layer["portal"] - if get_installer: - self.installer = get_installer(self.portal, self.layer["request"]) - else: - self.installer = api.portal.get_tool("portal_quickinstaller") - - def test_product_installed(self): - """Test if codesyntax.distributions is installed.""" - self.assertTrue(self.installer.is_product_installed("codesyntax.distributions")) - - def test_browserlayer(self): - """Test that ICodesyntaxDistributionsLayer is registered.""" - from codesyntax.distributions.interfaces import ICodesyntaxDistributionsLayer - from plone.browserlayer import utils - - self.assertIn(ICodesyntaxDistributionsLayer, utils.registered_layers()) - - -class TestUninstall(unittest.TestCase): - - layer = CODESYNTAX_DISTRIBUTIONS_INTEGRATION_TESTING - - def setUp(self): - self.portal = self.layer["portal"] - if get_installer: - self.installer = get_installer(self.portal, self.layer["request"]) - else: - self.installer = api.portal.get_tool("portal_quickinstaller") - roles_before = api.user.get_roles(TEST_USER_ID) - setRoles(self.portal, TEST_USER_ID, ["Manager"]) - self.installer.uninstall_product("codesyntax.distributions") - setRoles(self.portal, TEST_USER_ID, roles_before) - - def test_product_uninstalled(self): - """Test if codesyntax.distributions is cleanly uninstalled.""" - self.assertFalse( - self.installer.is_product_installed("codesyntax.distributions") - ) - - def test_browserlayer_removed(self): - """Test that ICodesyntaxDistributionsLayer is removed.""" - from codesyntax.distributions.interfaces import ICodesyntaxDistributionsLayer - from plone.browserlayer import utils - - self.assertNotIn(ICodesyntaxDistributionsLayer, utils.registered_layers())