Changeset 31adfa5 in OpenWorkouts-current for ow/tests/models/test_workout.py
- Timestamp:
- Dec 21, 2018, 11:00:25 AM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- fe6089a
- Parents:
- d507f75
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/tests/models/test_workout.py
rd507f75 r31adfa5 77 77 workout = Workout(start=start_date) 78 78 assert workout.start_time == start_date.strftime('%H:%M') 79 80 def test_start_in_timezone(self): 81 start_date = datetime.now(tz=timezone.utc) 82 str_start_date = start_date.strftime('%d/%m/%Y %H:%M (%Z)') 83 workout = Workout(start=start_date) 84 assert workout.start_in_timezone('UTC') == str_start_date 85 assert workout.start_in_timezone('Europe/Madrid') != str_start_date 86 assert workout.start_in_timezone('America/Vancouver') != str_start_date 87 88 def test_end_in_timezone(self): 89 start_date = datetime.now(tz=timezone.utc) 90 end_date = start_date + timedelta(minutes=60) 91 str_end_date = end_date.strftime('%d/%m/%Y %H:%M (%Z)') 92 workout = Workout(start=start_date, duration=timedelta(minutes=60)) 93 assert workout.end_in_timezone('UTC') == str_end_date 94 assert workout.end_in_timezone('Europe/Madrid') != str_end_date 95 assert workout.end_in_timezone('America/Vancouver') != str_end_date 79 96 80 97 def test_split_duration(self):
Note: See TracChangeset
for help on using the changeset viewer.