fixed dates

This commit is contained in:
Cayo Puigdefabregas 2020-11-26 18:51:36 +01:00
parent b072bc3b57
commit 988f5c1751
2 changed files with 1 additions and 3 deletions

View File

@ -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())

View File

@ -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'