Changeset dbfab70 in OpenWorkouts-current for ow/tests


Ignore:
Timestamp:
Jan 31, 2019, 12:33:38 PM (5 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
1183d5a, 9ab0fe3
Parents:
8fedd17
Message:

(#7) Show workouts in the profile page related to the highlighted/current month

selected in the yearly chart.

Also, allow users to click on the monthly bars on the chart, to choose that month.

File:
1 edited

Legend:

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

    r8fedd17 rdbfab70  
    267267        """
    268268        request = dummy_request
     269        # profile page for the current day (no workouts avalable)
    269270        response = user_views.profile(john, request)
    270         assert len(response.keys()) == 1
     271        assert len(response.keys()) == 2
    271272        current_month = datetime.now(timezone.utc).strftime('%Y-%m')
    272273        assert response['current_month'] == current_month
     274        assert response['workouts'] == []
     275        # profile page for a previous date, that has workouts
     276        request.GET['year'] = 2015
     277        request.GET['month'] = 8
     278        response = user_views.profile(john, request)
     279        assert len(response.keys()) == 2
     280        assert response['current_month'] == '2015-08'
     281        assert response['workouts'] == john.workouts(2015, 8)
    273282
    274283    def test_login_get(self, dummy_request):
Note: See TracChangeset for help on using the changeset viewer.