Adding tests for utils.dates
Review Request #8439 — Created Sept. 25, 2016 and submitted — Latest diff uploaded
Djblets has some utility functions for working with dates/timestamps
that did not have any unit tests for them.
The cursor of some text fields in an edit state displayed the standard
Added new DatesTests class to djblets/util/tests.py that covers
testing for:Calling http_date():
- With a datetime object.
- With a string representing a date.
- With an integer representing a Unix timestamp (seconds since the
epoch).Calling get_latest_timestamp():
- Without any timestamps in the list (result should be None)
- With a list of timestamps of different values in a jumbled,
unsorted order, checking that the latest gets returned.Calling get_tz_aware_utcnow() and checking that the resulting
datetime's timezone is UTC
Added tests