Changeset 3357e47 in OpenWorkouts-current for ow/tests/views/test_user.py


Ignore:
Timestamp:
Feb 4, 2019, 12:38:29 PM (5 years ago)
Author:
Borja Lopez <borja@…>
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.
Message:

Merged patches from darcs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/tests/views/test_user.py

    r1183d5a r3357e47  
    269269        # profile page for the current day (no workouts avalable)
    270270        response = user_views.profile(john, request)
    271         assert len(response.keys()) == 2
     271        assert len(response.keys()) == 3
    272272        current_month = datetime.now(timezone.utc).strftime('%Y-%m')
    273273        assert response['current_month'] == current_month
     274        assert response['current_week'] is None
    274275        assert response['workouts'] == []
    275276        # profile page for a previous date, that has workouts
     
    277278        request.GET['month'] = 8
    278279        response = user_views.profile(john, request)
    279         assert len(response.keys()) == 2
     280        assert len(response.keys()) == 3
    280281        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
    281301        assert response['workouts'] == john.workouts(2015, 8)
    282302
Note: See TracChangeset for help on using the changeset viewer.