fixed sporttracks bug
This commit is contained in:
@@ -781,7 +781,7 @@ def mocked_requests(*args, **kwargs):
|
||||
if ststrokestester.match(args[0]).group(1) == '13':
|
||||
return MockResponse(ststrokesjson_nogps,200)
|
||||
else:
|
||||
return MockResponse(strokesjson,200)
|
||||
return MockResponse(ststrokesjson,200)
|
||||
if stuploadtester.match(args[0]):
|
||||
json_data = {
|
||||
"uris": [
|
||||
|
||||
@@ -445,6 +445,19 @@ class STObjects(DjangoTestCase):
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
@patch('rowers.imports.requests.get', side_effect=mocked_requests)
|
||||
def test_sporttracks_import_all(self, mock_get):
|
||||
|
||||
response = self.c.get('/rowers/workout/sporttracksimport/all/',follow=True)
|
||||
|
||||
expected_url = reverse('workouts_view')
|
||||
|
||||
self.assertRedirects(response,
|
||||
expected_url=expected_url,
|
||||
status_code=302,target_status_code=200)
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
def test_strokedata(self, mocked_sqlalchemy):
|
||||
with open('rowers/tests/testdata/sporttrackstestdata.txt','r') as infile:
|
||||
|
||||
Reference in New Issue
Block a user