Fix fitbit tests ref=[#137599137]

This commit is contained in:
Ryan Marvin
2017-02-13 10:07:47 +03:00
parent 4bdca8b44a
commit 759832bde5

View File

@@ -1,5 +1,6 @@
from django.core.urlresolvers import reverse
from wger.core.tests.base_testcase import WorkoutManagerTestCase
from django.conf import settings
import requests
import json
@@ -7,11 +8,15 @@ import json
class SyncWithFitbitTestCase(WorkoutManagerTestCase):
def test_it_shows_instructions(self):
settings.WGER_SETTINGS['FITBIT_CLIENT_ID'] = '2283MF'
settings.WGER_SETTINGS['FITBIT_CLIENT_SECRET'] = 'thisisaclientsecret'
self.user_login()
r = self.client.get(reverse('core:user:fitbit'))
self.assertContains(r, "https://www.fitbit.com/oauth2/authorize", status_code=200)
def test_it_handles_oauth_response(self):
settings.WGER_SETTINGS['FITBIT_CLIENT_ID'] = '2283MF'
settings.WGER_SETTINGS['FITBIT_CLIENT_SECRET'] = 'thisisaclientsecret'
oauth_response = {"access_token": "test-token"}
url = reverse('core:user:fitbit')