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

Align tests with redturtle.prenotazioni > 2.2.5 #33

Merged
merged 2 commits into from
Dec 19, 2023
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
86 changes: 42 additions & 44 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,41 @@ jobs:
fail-fast: true
matrix:
config:
- ["3.8", "py38-plone60"]
- ["3.9", "py39-plone60"]
- ["3.10", "py310-plone60"]
- ["3.11", "py311-plone60"]
- ["3.9", "py39-plone60"]
- ["3.10", "py310-plone60"]
- ["3.11", "py311-plone60"]
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
with:
path: |
~/.cache/pip
eggs
.tox
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
- name: Upload coverage data to coveralls.io
run: |
pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.config[1] }}
COVERALLS_PARALLEL: true
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
with:
path: |
~/.cache/pip
eggs
.tox
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
- name: Upload coverage data to coveralls.io
run: |
pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.config[1] }}
COVERALLS_PARALLEL: true
# - name: Upload coverage data to coveralls.io
# uses: coverallsapp/github-action@v2
# with:
Expand All @@ -59,13 +58,12 @@ jobs:
# if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
run: |
pip install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# uses: coverallsapp/github-action@v2
# with:
# parallel-finished: true

- name: Coveralls Finished
run: |
pip install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# uses: coverallsapp/github-action@v2
# with:
# parallel-finished: true
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
1.2.1 (unreleased)
------------------

- Nothing changed yet.
- Align tests with redturtle.prenotazioni > 2.2.5.
[cekk]


1.2.0 (2023-11-20)
Expand Down
16 changes: 8 additions & 8 deletions src/design/plone/ioprenoto/tests/test_stringinterp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import unittest
from datetime import date, datetime
from datetime import datetime

import transaction
from plone import api
Expand All @@ -9,6 +9,7 @@
from plone.stringinterp.interfaces import IContextWrapper, IStringSubstitution
from plone.volto.interfaces import IVoltoSettings
from redturtle.prenotazioni.adapters.booker import IBooker
from redturtle.prenotazioni.tests.helpers import WEEK_TABLE_SCHEMA
from z3c.relationfield.relation import RelationValue
from zope.component import getAdapter, getUtility, queryUtility
from zope.intid.interfaces import IIntIds
Expand All @@ -25,6 +26,8 @@ def setUp(self):
self.portal_url = self.portal.absolute_url()
setRoles(self.portal, TEST_USER_ID, ["Manager"])

self.today = datetime.now()

self.unita_organizzativa = api.content.create(
container=self.portal,
type="UnitaOrganizzativa",
Expand All @@ -45,18 +48,15 @@ def setUp(self):
type="PrenotazioniFolder",
title="Prenota foo",
description="",
daData=date.today(),
daData=self.today.date(),
gates=["Gate A"],
uffici_correlati=[
RelationValue(
to_id=queryUtility(IIntIds).getId(self.unita_organizzativa)
)
],
week_table=WEEK_TABLE_SCHEMA,
)
week_table = self.folder_prenotazioni.week_table
week_table[0]["morning_start"] = "0700"
week_table[0]["morning_end"] = "1000"
self.folder_prenotazioni.week_table = week_table
api.content.transition(
obj=api.content.create(
type="PrenotazioneType",
Expand All @@ -79,9 +79,9 @@ def setUp(self):
)

booker = IBooker(self.folder_prenotazioni)
self.prenotazione = booker.create(
self.prenotazione = booker.book(
{
"booking_date": datetime.now(),
"booking_date": self.today.replace(hour=8, minute=0),
"booking_type": "Type A",
"title": "foo",
}
Expand Down
Loading