gets a valid DF out of NK
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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/',
|
||||
|
||||
Reference in New Issue
Block a user