Skip to content

Commit

Permalink
Align tests with redturtle.prenotazioni > 2.2.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Dec 18, 2023
1 parent bade8f9 commit 7a6e517
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
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

0 comments on commit 7a6e517

Please sign in to comment.