feat(core): support negative numbers when Calculating ticket duration for ticket meta and comments
enables time to be subtracted when negative value added to duration field. ref: #250 #96 #93 #95 #90 #264 #266
This commit is contained in:
@ -42,10 +42,17 @@ def to_duration(value):
|
||||
str: Duration value in format 00h 00m 00s
|
||||
"""
|
||||
|
||||
hours = int(int(value)//3600)
|
||||
hour = int(3600)
|
||||
minute = int(60)
|
||||
|
||||
minutes = int((int(value)%3600)//60)
|
||||
if '-' in value:
|
||||
hour = int(-3600)
|
||||
minute = int(-60)
|
||||
|
||||
seconds = int((int(value)%3600)%60)
|
||||
hours = int(int(value)//hour)
|
||||
|
||||
minutes = int((int(value)%hour)//minute)
|
||||
|
||||
seconds = int((int(value)%hour)%minute)
|
||||
|
||||
return str("{:02d}h {:02d}m {:02d}s".format(hours, minutes, seconds))
|
||||
|
@ -821,6 +821,16 @@ class TicketPermissions(
|
||||
assert action_comment
|
||||
|
||||
|
||||
@pytest.mark.skip(reason='to be written')
|
||||
def test_ticket_action_comment_project_added(self):
|
||||
"""Action Comment test
|
||||
Confirm a 'project added' action comment is created for the ticket
|
||||
when a project is added
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason='to be written')
|
||||
def test_ticket_action_comment_related_ticket_removed(self):
|
||||
"""Action Comment test
|
||||
|
Reference in New Issue
Block a user