passing tests for nk_list
This commit is contained in:
@@ -918,6 +918,13 @@ def mocked_requests(*args, **kwargs):
|
||||
|
||||
|
||||
if nktester.match(args[0]):
|
||||
if 'token' in args[0]:
|
||||
json_data = {
|
||||
'access_token': 'TA3n1vrNjuQJWw0TdCDHnjSmrjIPULhTlejMIWqq',
|
||||
'expires_in': 604800,
|
||||
'refresh_token': 'jHJhFzCfOOKB8oyiayubhLAlxaMkG3ruC1E8YxaR'
|
||||
}
|
||||
return MockResponse(json_data,200)
|
||||
if nkworkoutlisttester.match(args[0]):
|
||||
return MockResponse(nkworkoutlist,200)
|
||||
elif 'token' in args[0]:
|
||||
|
||||
@@ -419,7 +419,7 @@ class NKObjects(DjangoTestCase):
|
||||
@patch('rowers.nkstuff.requests.post', side_effect=mocked_requests)
|
||||
def test_nk_list(self, mock_get, mockpost):
|
||||
result = rowers.nkstuff.rower_nk_token_refresh(self.u)
|
||||
self.assertEqual(result,"987654321234567898765432123456789")
|
||||
self.assertEqual(result,"TA3n1vrNjuQJWw0TdCDHnjSmrjIPULhTlejMIWqq")
|
||||
response = self.c.get('/rowers/workout/nkimport/')
|
||||
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
Reference in New Issue
Block a user