tests: check latest arrival trigger is applied even after leaving the status
This commit is contained in:
parent
c62e48b77b
commit
194faf5115
|
@ -3586,6 +3586,31 @@ def test_global_timeouts_latest_arrival(two_pubs):
|
|||
# change
|
||||
assert formdef.data_class().get(formdata1.id).get_criticality_level_object().name == 'yellow'
|
||||
|
||||
# check it applies even after the status has been left
|
||||
formdata1 = formdef.data_class()()
|
||||
formdata1.just_created()
|
||||
formdata1.store()
|
||||
formdata1.jump_status('new')
|
||||
formdata1.evolution[-1].time = time.localtime(time.time()-5*86400)
|
||||
formdata1.store()
|
||||
formdata1.jump_status('accepted')
|
||||
formdata1.store()
|
||||
pub.apply_global_action_timeouts()
|
||||
assert formdef.data_class().get(formdata1.id).get_criticality_level_object().name == 'yellow'
|
||||
|
||||
# but not if an endpoint has been reached
|
||||
formdata1 = formdef.data_class()()
|
||||
formdata1.just_created()
|
||||
formdata1.store()
|
||||
formdata1.jump_status('new')
|
||||
formdata1.evolution[-1].time = time.localtime(time.time()-5*86400)
|
||||
formdata1.store()
|
||||
formdata1.jump_status('accepted')
|
||||
formdata1.jump_status('finished')
|
||||
formdata1.store()
|
||||
pub.apply_global_action_timeouts()
|
||||
assert formdef.data_class().get(formdata1.id).get_criticality_level_object().name == 'green'
|
||||
|
||||
|
||||
def test_profile(two_pubs):
|
||||
User = two_pubs.user_class
|
||||
|
|
Loading…
Reference in New Issue