Skip to content

Commit

Permalink
Merge pull request #166 from collective/config-with-default-template-…
Browse files Browse the repository at this point in the history
…5d22fbf8

Update config and fix attribute rendering in widget template
  • Loading branch information
1letter authored Oct 17, 2024
2 parents 17633f3 + 759181d commit 373c22c
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 119 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ parts/
pyvenv.cfg
var/
local.cfg
.python-version

# mxdev
/instance/
Expand All @@ -47,8 +46,6 @@ local.cfg
/venv/
.installed.txt

robot_*
test_*
forest.*

##
Expand Down
4 changes: 1 addition & 3 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "721299ce"
commit-id = "5d22fbf8"

[pyproject]
codespell_skip = "*.js,*.min.js,*.min.js.map,*.min.css.map,*.svg,*.lock,*.json"
Expand All @@ -17,7 +17,5 @@ jobs = [

[gitignore]
extra_lines = """
robot_*
test_*
forest.*
"""
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand All @@ -16,7 +16,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/collective/zpretty
Expand All @@ -32,7 +32,7 @@ repos:
# """
##
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8

Expand All @@ -44,7 +44,7 @@ repos:
# """
##
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -71,7 +71,7 @@ repos:
- id: check-python-versions
args: ['--only', 'setup.py,pyproject.toml']
- repo: https://github.com/collective/i18ndude
rev: "6.2.0"
rev: "6.2.1"
hooks:
- id: i18ndude

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ target-version = ["py38"]
##

[tool.codespell]
ignore-words-list = "discreet,"
ignore-words-list = "discreet,assertin,"
skip = "*.po,*.js,*.min.js,*.min.js.map,*.min.css.map,*.svg,*.lock,*.json"
##
# Add extra configuration options in .meta.toml:
Expand Down Expand Up @@ -83,6 +83,7 @@ Zope = [
'Products.CMFCore', 'Products.CMFDynamicViewFTI',
]
python-dateutil = ['dateutil']
pytest-plone = ['pytest', 'zope.pytestlayer', 'plone.testing', 'plone.app.testing']

##
# Add extra configuration options in .meta.toml:
Expand Down
78 changes: 78 additions & 0 deletions src/collective/taxonomy/tests/robot/test_taxonomy.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
*** Settings ***

Resource plone/app/robotframework/browser.robot

Library Remote ${PLONE_URL}/RobotRemote
Library Collections

Test Setup Run Keywords Plone test setup
Test Teardown Run keywords Plone test teardown


*** Variables ***

${TITLE} An edited page
${PAGE_ID} an-edited-page


*** Test Cases ***

Scenario: As a manager I can add a taxonomy
Given a logged in manager
and an page type with a taxonomy
When I edit the page
and I select multiple options
Then I see '2' selected options

When I save the page
and I edit the page
and I deselect option 'Information Science'
Then I see '1' selected options

*** Keywords ***

# Given

a logged in manager
Enable autologin as Manager

an page type with a taxonomy
Create content
... type=Document
... title=${TITLE}

Go to ${PLONE_URL}/dexterity-types/Document/@@behaviors
Check Checkbox //input[@name="form.widgets.collective.taxonomy.generated.test:list"]
Click //button[@name="form.buttons.apply"]
Wait For Condition Text //body contains Behaviors successfully updated.

# When
I edit the page
Go to ${PLONE_URL}/${PAGE_ID}/edit
Get Text //body contains Edit Page

I select multiple options
Select Options By //select[@name="form.widgets.test.taxonomy_test.from"] index 0 2
Click //button[@name="from2toButton"]

I save the page
Click //button[@name="form.buttons.save"]
Wait For Condition Text //body contains Changes saved

I deselect option '${label}'
Select Options By //select[@name="form.widgets.test.taxonomy_test.to"] label ${label}
Click //button[@name="to2fromButton"]

# Then
I see '${count}' selected options
Get Element Count //select[@name="form.widgets.test.taxonomy_test.to"]/option should be ${count}

# Misc

Pause
[Documentation] Visually pause test execution with interactive dialog by
... importing **Dialogs**-library and calling its
... **Pause Execution**-keyword.
Import library Dialogs
Pause execution

105 changes: 0 additions & 105 deletions src/collective/taxonomy/tests/robot/todo_test_taxonomy.robot

This file was deleted.

2 changes: 0 additions & 2 deletions src/collective/taxonomy/widget_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ function selectionError() {
<td>
<select class=""
id="from"
multiple
name="from"
size="5"
style="width: 100%"
Expand Down Expand Up @@ -214,7 +213,6 @@ function selectionError() {
<td style="text-align: right">
<select class=""
id="to"
multiple
name="to"
size="5"
style="width: 100%"
Expand Down

0 comments on commit 373c22c

Please sign in to comment.