Skip to content

Change method of getting time in test cases,

Corresponding merge request in Hive: hive!769 (merged)
Related: haf!195 (merged)

Time class extension, add a function that replaces the date_from_now function

Changes in class Time:

  • new staticmethods - weeks, month, year.
  • now function - return type changed (datetime -> string representing the time).
  • new function from_now - replaces the deprecated date_from_now. Generates the date shifted by the value given in the arguments. Example use:
  tt.Time.from_now(seconds=60)  # 60 seconds ahead
  tt.Time.from_now(minutes=-1)  # 1 minute back
  tt.Time.from_now(days=1, hours=-2)  #  22 hours ahead 
Edited by Mateusz Żebrak

Merge request reports