Changeset 3357e47 in OpenWorkouts-current for ow/tests/views/test_user.py
- Timestamp:
- Feb 4, 2019, 12:38:29 PM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- 6993c72
- Parents:
- 1183d5a (diff), 5cf5787 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/tests/views/test_user.py
r1183d5a r3357e47 269 269 # profile page for the current day (no workouts avalable) 270 270 response = user_views.profile(john, request) 271 assert len(response.keys()) == 2271 assert len(response.keys()) == 3 272 272 current_month = datetime.now(timezone.utc).strftime('%Y-%m') 273 273 assert response['current_month'] == current_month 274 assert response['current_week'] is None 274 275 assert response['workouts'] == [] 275 276 # profile page for a previous date, that has workouts … … 277 278 request.GET['month'] = 8 278 279 response = user_views.profile(john, request) 279 assert len(response.keys()) == 2280 assert len(response.keys()) == 3 280 281 assert response['current_month'] == '2015-08' 282 assert response['current_week'] is None 283 assert response['workouts'] == john.workouts(2015, 8) 284 # same, passing a week, first on a week without workouts 285 request.GET['year'] = 2015 286 request.GET['month'] = 8 287 request.GET['week'] = 25 288 response = user_views.profile(john, request) 289 assert len(response.keys()) == 3 290 assert response['current_month'] == '2015-08' 291 assert response['current_week'] is 25 292 assert response['workouts'] == [] 293 # now in a week with workoutss 294 request.GET['year'] = 2015 295 request.GET['month'] = 8 296 request.GET['week'] = 26 297 response = user_views.profile(john, request) 298 assert len(response.keys()) == 3 299 assert response['current_month'] == '2015-08' 300 assert response['current_week'] is 26 281 301 assert response['workouts'] == john.workouts(2015, 8) 282 302
Note: See TracChangeset
for help on using the changeset viewer.