Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2023-02-11 17:33:31 +01:00
parent eaedf30369
commit def98b9a85
4 changed files with 6 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ import arrow
import urllib
from uuid import uuid4
import json
class SyncIntegration(metaclass=ABCMeta):
oauth_data = {

View File

@@ -203,13 +203,13 @@ class StravaIntegration(SyncIntegration):
_ = self.open()
except NoTokenError:
return 0
csvfilename = 'media/{code}_{stravaid}.csv'.format(
code=uuid4().hex[:16], stravaid=stravaid)
csvfilename = 'media/{code}_{id}.csv'.format(
code=uuid4().hex[:16], id=id)
job = myqueue(queue,
fetch_strava_workout,
self.rower.stravatoken,
oauth_data,
self.oauth_data,
id,
csvfilename,
self.user.id,
@@ -311,7 +311,7 @@ class StravaIntegration(SyncIntegration):
# token_refresh
def token_refresh(self, *args, **kwargs):
return super(StravaIntegration).token_refresh(*args, **kwargs)
return super(StravaIntegration, self).token_refresh(*args, **kwargs)
def set_strava_athlete_id():
r = self.rower()

View File

@@ -1164,7 +1164,7 @@ class StravaObjects(DjangoTestCase):
self.assertEqual(response.status_code, 200)
@patch('rowers.integrations.strava.requests.post', side_effect=mocked_requests)
@patch('rowers.integrations.integrations.requests.post', side_effect=mocked_requests)
def test_strava_callback(self, mock_post):
response = self.c.get('/stravacall_back?code=absdef23&scope=read',follow=True)
self.assertEqual(response.status_code, 200)

BIN
rowers/tests/testdata/testdata.tcx.gz vendored Normal file

Binary file not shown.