fixed dates
This commit is contained in:
parent
b072bc3b57
commit
988f5c1751
|
@ -104,7 +104,6 @@ class Deallocate(ActionWithMultipleDevices):
|
||||||
@validates_schema
|
@validates_schema
|
||||||
def validate_deallocate(self, data: dict):
|
def validate_deallocate(self, data: dict):
|
||||||
txt = "You need to deallocate for a day before today"
|
txt = "You need to deallocate for a day before today"
|
||||||
import pdb; pdb.set_trace()
|
|
||||||
delay = timedelta(days=1)
|
delay = timedelta(days=1)
|
||||||
today = datetime.now().replace(tzinfo=tzutc()) + delay
|
today = datetime.now().replace(tzinfo=tzutc()) + delay
|
||||||
start_time = data['start_time'].replace(tzinfo=tzutc())
|
start_time = data['start_time'].replace(tzinfo=tzutc())
|
||||||
|
|
|
@ -381,9 +381,8 @@ def test_deallocate_bad_dates(user: UserClient):
|
||||||
"start_time": "2020-11-01T02:00:00+00:00"
|
"start_time": "2020-11-01T02:00:00+00:00"
|
||||||
}
|
}
|
||||||
|
|
||||||
import pdb; pdb.set_trace()
|
|
||||||
user.post(res=models.Allocate, data=post_allocate)
|
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['code'] == 422
|
||||||
assert res['type'] == 'ValidationError'
|
assert res['type'] == 'ValidationError'
|
||||||
|
|
||||||
|
|
Reference in New Issue