Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #388

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/collective/zpretty
Expand All @@ -32,7 +32,7 @@ repos:
# """
##
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8

Expand Down
7 changes: 1 addition & 6 deletions plone/app/event/dx/behaviors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Behaviors to enable calendarish event extension to dexterity content types.
"""

from plone.app.dexterity.behaviors.metadata import ICategorization
from plone.app.event import _
from plone.app.event.base import default_end as default_end_dt
Expand Down Expand Up @@ -61,7 +62,6 @@ def default_end(context):


class IEventBasic(model.Schema, IDXEvent):

"""Basic event schema."""

start = schema.Datetime(
Expand Down Expand Up @@ -129,7 +129,6 @@ def validate_start_end(data):


class IEventRecurrence(model.Schema, IDXEventRecurrence):

"""Recurring Event Schema."""

recurrence = schema.Text(
Expand All @@ -151,7 +150,6 @@ class IEventRecurrence(model.Schema, IDXEventRecurrence):


class IEventLocation(model.Schema):

"""Event Location Schema."""

location = schema.TextLine(
Expand All @@ -164,7 +162,6 @@ class IEventLocation(model.Schema):


class IEventAttendees(model.Schema):

"""Event Attendees Schema."""

attendees = schema.Tuple(
Expand All @@ -179,7 +176,6 @@ class IEventAttendees(model.Schema):


class IEventContact(model.Schema):

"""Event Contact Schema."""

contact_name = schema.TextLine(
Expand Down Expand Up @@ -282,7 +278,6 @@ def sync_uid_indexer(obj):
@adapter(IDXEvent)
@implementer(IEventAccessor)
class EventAccessor:

"""Generic event accessor adapter implementation for Dexterity content
objects.
"""
Expand Down
72 changes: 36 additions & 36 deletions plone/app/event/tests/test_dx_behaviors.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ def test_defaults(self):
)
)

self.browser.getControl(
name="form.widgets.IDublinCore.title"
).value = "TestEvent"
self.browser.getControl(name="form.widgets.IDublinCore.title").value = (
"TestEvent"
)

# TODO: these values are simply not set in the pat-pickadate pattern.
self.browser.getControl(
name="form.widgets.IEventBasic.start"
).value = "2014-03-30"
self.browser.getControl(
name="form.widgets.IEventBasic.end"
).value = "2014-03-31"
self.browser.getControl(name="form.widgets.IEventBasic.start").value = (
"2014-03-30"
)
self.browser.getControl(name="form.widgets.IEventBasic.end").value = (
"2014-03-31"
)

self.browser.getControl("Save").click()

Expand Down Expand Up @@ -165,17 +165,17 @@ def test_edit_context(self):
#
self.browser.open(self.portal.absolute_url())
self.browser.getLink("plone.app.event.dx.event").click()
self.browser.getControl(
name="form.widgets.IDublinCore.title"
).value = "TestEvent"
self.browser.getControl(name="form.widgets.IDublinCore.title").value = (
"TestEvent"
)

self.browser.getControl(
name="form.widgets.IEventBasic.start"
).value = "2014-03-30T03:51"
self.browser.getControl(name="form.widgets.IEventBasic.start").value = (
"2014-03-30T03:51"
)

self.browser.getControl(
name="form.widgets.IEventBasic.end"
).value = "2014-03-30T04:51"
self.browser.getControl(name="form.widgets.IEventBasic.end").value = (
"2014-03-30T04:51"
)

self.browser.getControl("Save").click()

Expand All @@ -191,13 +191,13 @@ def test_edit_context(self):
testevent = self.portal.testevent
self.browser.open("%s/@@edit" % testevent.absolute_url())

self.browser.getControl(
name="form.widgets.IEventBasic.start"
).value = "2014-03-31T03:51"
self.browser.getControl(name="form.widgets.IEventBasic.start").value = (
"2014-03-31T03:51"
)

self.browser.getControl(
name="form.widgets.IEventBasic.end"
).value = "2014-03-31T04:51"
self.browser.getControl(name="form.widgets.IEventBasic.end").value = (
"2014-03-31T04:51"
)

self.browser.getControl("Save").click()

Expand Down Expand Up @@ -574,15 +574,15 @@ def test_migrate_fields(self):
ann = IAnnotations(e1)
ann["plone.app.event.dx.behaviors.IEventLocation.location"] = self.location
ann["plone.app.event.dx.behaviors.IEventAttendees.attendees"] = self.attendees
ann[
"plone.app.event.dx.behaviors.IEventContact.contact_email"
] = self.contact_email
ann[
"plone.app.event.dx.behaviors.IEventContact.contact_name"
] = self.contact_name
ann[
"plone.app.event.dx.behaviors.IEventContact.contact_phone"
] = self.contact_phone
ann["plone.app.event.dx.behaviors.IEventContact.contact_email"] = (
self.contact_email
)
ann["plone.app.event.dx.behaviors.IEventContact.contact_name"] = (
self.contact_name
)
ann["plone.app.event.dx.behaviors.IEventContact.contact_phone"] = (
self.contact_phone
)
ann["plone.app.event.dx.behaviors.IEventContact.event_url"] = self.event_url
ann["plone.app.event.dx.behaviors.IEventSummary.text"] = RichTextValue(
raw=self.text
Expand Down Expand Up @@ -624,9 +624,9 @@ def test_no_overwrite(self):
ann["plone.app.event.dx.behaviors.IEventLocation.location"] = (
self.location + "X"
)
ann[
"plone.app.event.dx.behaviors.IEventAttendees.attendees"
] = self.attendees + ("Paula",)
ann["plone.app.event.dx.behaviors.IEventAttendees.attendees"] = (
self.attendees + ("Paula",)
)
ann["plone.app.event.dx.behaviors.IEventContact.contact_email"] = (
self.contact_email + "X"
)
Expand Down
6 changes: 3 additions & 3 deletions plone/app/event/tests/test_ical_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def test_constraint(self):
self.assertIn(
"URL to an external icalendar resource file", self.browser.contents
)
self.browser.getControl(
name="form.widgets.ical_url"
).value = "file:///tmp/test.ical"
self.browser.getControl(name="form.widgets.ical_url").value = (
"file:///tmp/test.ical"
)
self.browser.getControl(name="form.buttons.save").click()
self.assertIn("URLs with file: are not allowed.", self.browser.contents)