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

Fix tests for python2 in branch 7.x.x #1721

Merged
merged 22 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from 20 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
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ on: [push]
jobs:
build:
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.7, 3.6, 2.7]
python-version: [3.8, 3.7, 2.7]
plone-version: [5.2, 5.1, 4.3]
exclude:
- python-version: 3.6
Expand Down Expand Up @@ -35,14 +37,15 @@ jobs:
# python setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
if: ${{ matrix.python-version != 2.7 }}
with:
python-version: ${{ matrix.python-version }}

# python cache
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

Expand Down
2 changes: 2 additions & 0 deletions news/1721.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
New version pins to run tests
[erral]
6 changes: 6 additions & 0 deletions plone-4.3.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ six = 1.12.0

# latest version compatible with Python 2
plone.schema = 1.4.0

# latest version compatible with Python 2
sphinxcontrib-websupport = 1.1.2
stdlib-list = 0.6.0
zest.pocompile = 1.6.0
plone.rest = 3.0.2
3 changes: 3 additions & 0 deletions plone-5.1.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ pyparsing = 2.4.7

# Required by plone.restapi
six = 1.12.0
stdlib-list = 0.6.0
zest.pocompile= 1.6.0
plone.rest = 3.0.2
1 change: 1 addition & 0 deletions plone-5.2.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ importlib-metadata = 2.0.0

# latest version compatible with Python 2
flake8-print = 4.0.1
zest.pocompile= 1.6.0
14 changes: 10 additions & 4 deletions src/plone/restapi/tests/test_dxfield_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,20 @@ def setUp(self):
]

def serialize(self, fieldname, value):
field = None
for schema in iterSchemata(self.doc1):
if fieldname in schema:
field = schema.get(fieldname)
break
dm = getMultiAdapter((self.doc1, field), IDataManager)
dm.set(value)
serializer = getMultiAdapter((field, self.doc1, self.request), IFieldSerializer)
return serializer()
if field is not None:
dm = getMultiAdapter((self.doc1, field), IDataManager)
dm.set(value)
serializer = getMultiAdapter(
(field, self.doc1, self.request), IFieldSerializer
)
return serializer()

return None

def test_ascii_field_serialization_returns_unicode(self):
value = self.serialize("test_ascii_field", "foo")
Expand Down
Loading