Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Oct 13, 2023
1 parent 0c77966 commit 7c3c0c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# -*- coding: utf-8 -*-
from plone import api
from plone.restapi.interfaces import ISerializeToJson
from plone.restapi.serializer.dxcontent import SerializeFolderToJson
from zope.component import adapter
from zope.interface import implementer
from plone import api

from redturtle.prenotazioni.content.prenotazioni_folder import (
IPrenotazioniFolder,
)
from redturtle.prenotazioni.content.prenotazioni_folder import IPrenotazioniFolder
from redturtle.prenotazioni.interfaces import IRedturtlePrenotazioniLayer


Expand All @@ -18,9 +16,7 @@ def __call__(self, *args, **kwargs):
res = super().__call__()

if res.get("booking_types"):
if api.user.has_permission(
"redturtle.prenotazioni.ViewHiddenTypes"
):
if api.user.has_permission("redturtle.prenotazioni.ViewHiddenTypes"):
return res

res["booking_types"] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
from plone.restapi.testing import RelativeSession

from redturtle.prenotazioni.adapters.booker import IBooker
from redturtle.prenotazioni.testing import (
REDTURTLE_PRENOTAZIONI_INTEGRATION_TESTING,
)
from redturtle.prenotazioni.testing import REDTURTLE_PRENOTAZIONI_INTEGRATION_TESTING
from redturtle.prenotazioni.tests.helpers import WEEK_TABLE_SCHEMA


Expand Down Expand Up @@ -84,18 +82,10 @@ def test_get_free_slots_skip_bookigs_inside_pause_range(self):
res = view.get_free_slots(today)
# available slots are only arount the pause and not inside it
self.assertEqual(len(res["Gate A"]), 2)
self.assertEqual(
view.get_free_slots(today)["Gate A"][0].start(), "07:00"
)
self.assertEqual(
view.get_free_slots(today)["Gate A"][0].stop(), "08:00"
)
self.assertEqual(
view.get_free_slots(today)["Gate A"][1].start(), "11:00"
)
self.assertEqual(
view.get_free_slots(today)["Gate A"][1].stop(), "13:00"
)
self.assertEqual(view.get_free_slots(today)["Gate A"][0].start(), "07:00")
self.assertEqual(view.get_free_slots(today)["Gate A"][0].stop(), "08:00")
self.assertEqual(view.get_free_slots(today)["Gate A"][1].start(), "11:00")
self.assertEqual(view.get_free_slots(today)["Gate A"][1].stop(), "13:00")

def test_get_free_slots_handle_pauses_correctly(self):
booker = IBooker(self.folder_prenotazioni)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
from zope.interface import implementer
from zope.interface.interfaces import IObjectEvent

from redturtle.prenotazioni.testing import REDTURTLE_PRENOTAZIONI_FUNCTIONAL_TESTING
from redturtle.prenotazioni.tests.helpers import WEEK_TABLE_SCHEMA
from redturtle.prenotazioni.testing import (
REDTURTLE_PRENOTAZIONI_FUNCTIONAL_TESTING,
)


@implementer(IObjectEvent)
Expand Down

0 comments on commit 7c3c0c5

Please sign in to comment.