Private
Public Access
1
0

more stravastuff coverage

This commit is contained in:
Sander Roosendaal
2021-04-22 18:20:59 +02:00
parent b37bfe2735
commit 99dfb171b5
3 changed files with 25 additions and 3 deletions

View File

@@ -818,7 +818,7 @@ def workout_strava_upload(user,w, quick=False,asynchron=True):
w.save()
os.remove(tcxfile)
return message,stravaid
return message,stravaid
return message,stravaid # pragma: no cover
@@ -916,7 +916,7 @@ def handle_strava_import_stroke_data(title,
lon = coords[:,1]
if lat.std() == 0 and lon.std() == 0 and workouttype == 'water': # pragma: no cover
workouttype = 'rower'
except IndexError:
except IndexError: # pragma: no cover
lat = np.zeros(len(t))
lon = np.zeros(len(t))
if workouttype == 'water':

View File

@@ -1852,6 +1852,28 @@ description: ""
response = self.c.get(url)
self.assertEqual(response.status_code,200)
url = reverse('plannedsessions_print_view',kwargs={
'userid':self.r.user.id,
'startdatestring':self.ps_trimp.startdate.strftime("%Y-%m-%d"),
'enddatestring':self.ps_trimp.enddate.strftime("%Y-%m-%d"),
})
response = self.c.get(url)
self.assertEqual(response.status_code,200)
# create shareable link
form_data = {
'url': url,
'ndays': '7'
}
urlshare = '/rowers/access/share/'
response = self.c.post(urlshare,form_data)
self.assertEqual(response.status_code,200)
def test_plannedsessions_dateform_view(self):
login = self.c.login(username=self.u.username, password=self.password)
self.assertTrue(login)

View File

@@ -293,7 +293,7 @@ def get_totals(workouts):
def allow_shares(view_func):
def sharify(request, *args, **kwargs):
shared = kwargs.get('__shared', None)
if shared is not None:
if shared is not None: # pragma: no cover
del kwargs["__shared"]
request.session['shared'] = True
return view_func(request, *args, **kwargs)