From 988f5c175103740ccb1af978eba16e4d73c40e8b Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 26 Nov 2020 18:51:36 +0100 Subject: [PATCH] fixed dates --- ereuse_devicehub/resources/action/schemas.py | 1 - tests/test_action.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ereuse_devicehub/resources/action/schemas.py b/ereuse_devicehub/resources/action/schemas.py index 168bcb3e..d160d83b 100644 --- a/ereuse_devicehub/resources/action/schemas.py +++ b/ereuse_devicehub/resources/action/schemas.py @@ -104,7 +104,6 @@ class Deallocate(ActionWithMultipleDevices): @validates_schema def validate_deallocate(self, data: dict): txt = "You need to deallocate for a day before today" - import pdb; pdb.set_trace() delay = timedelta(days=1) today = datetime.now().replace(tzinfo=tzutc()) + delay start_time = data['start_time'].replace(tzinfo=tzutc()) diff --git a/tests/test_action.py b/tests/test_action.py index 410fb265..d9231923 100644 --- a/tests/test_action.py +++ b/tests/test_action.py @@ -381,9 +381,8 @@ def test_deallocate_bad_dates(user: UserClient): "start_time": "2020-11-01T02:00:00+00:00" } - import pdb; pdb.set_trace() user.post(res=models.Allocate, data=post_allocate) - res, _ = user.post(res=models.Deallocate, data=post_deallocate, status=400) + res, _ = user.post(res=models.Deallocate, data=post_deallocate, status=422) assert res['code'] == 422 assert res['type'] == 'ValidationError'