Private
Public Access
1
0

gets a valid DF out of NK

This commit is contained in:
Sander Roosendaal
2021-04-02 10:52:30 +02:00
parent c4b20fb9e0
commit 0fc6ecb70c
3 changed files with 20 additions and 11 deletions

View File

@@ -758,7 +758,7 @@ def mocked_requests(*args, **kwargs):
nkworkoutlistregex = '.*?nkrowlink\.com\/api\/v1\/sessions'
nkworkoutlisttester = re.compile(nkworkoutlistregex)
nkstrokesregex = '.*?nkrowlink\.com\/api\/v1\/strokes\?sessionIds=\d'
nkstrokesregex = '.*?nkrowlink\.com\/api\/v1\/sessions\/strokes'
nkstrokestester = re.compile(nkstrokesregex)
stravaathleteregex = '.*?strava\.com\/api\/v3\/athlete$'
@@ -927,6 +927,7 @@ def mocked_requests(*args, **kwargs):
if nktester.match(args[0]):
if 'token' in args[0]:
json_data = {
'access_token': 'TA3n1vrNjuQJWw0TdCDHnjSmrjIPULhTlejMIWqq',
@@ -935,8 +936,10 @@ def mocked_requests(*args, **kwargs):
}
return MockResponse(json_data,200)
if nkstrokestester.match(args[0]):
return MockResponse(nkstrokedata,200)
if nkworkoutlisttester.match(args[0]):
return MockResponse(nkworkoutlist,200)

View File

@@ -431,7 +431,7 @@ class NKObjects(DjangoTestCase):
mocked_getsmallrowdata_db):
result = rowers.nkstuff.rower_nk_token_refresh(self.u)
response = self.c.get('/rowers/workout/nkimport/12',follow=True)
response = self.c.get('/rowers/workout/nkimport/469',follow=True)
self.assertRedirects(response,
expected_url='/rowers/workout/'+encoded2+'/edit/',