Ejemplo n.º 1
0
 def test_strava_activities_endpoint_takes_query_parameters(self):
     request = self.factory.get('fake/url', {
         'distance': 'miles',
         'max_speed': 'miles.hour'
     })
     request.user = self.user
     StravaActivities.as_view()(request)
     self.client.get_activities.assert_called_with(
         request.user, distance='miles', max_speed=['miles', 'hour'])
Ejemplo n.º 2
0
from django.conf.urls import patterns, url

from strava_client.views import StravaUser, StravaActivities


urlpatterns = patterns(
    '',
    url(r'me/?$', StravaUser.as_view(), name='strava-me'),
    url(r'activities/?$', StravaActivities.as_view(), name='strava-activites')
)
Ejemplo n.º 3
0
 def test_strava_activities_endpoint_returns_activities_data(self):
     response = StravaActivities.as_view()(self.request)
     response.render()
     self.assertEqual(json.loads(response.content), {'distance': 10})