more coverage related
This commit is contained in:
@@ -8,12 +8,14 @@ from .statements import *
|
||||
nu = datetime.datetime.now()
|
||||
|
||||
from rowers.utils import allmonths,allsundays
|
||||
from rowers import garmin_stuff
|
||||
|
||||
import rowers.plannedsessions as plannedsessions
|
||||
from django.db import transaction
|
||||
|
||||
from rowers.views.workoutviews import plannedsession_compare_view
|
||||
from rowers.opaque import encoder
|
||||
from django.utils.crypto import get_random_string
|
||||
|
||||
@override_settings(TESTING=True)
|
||||
class TrainingPlanTest(TestCase):
|
||||
@@ -93,7 +95,7 @@ class TrainingPlanTest(TestCase):
|
||||
for url in urls:
|
||||
if 'macrocycle' in url and 'delete' not in url:
|
||||
macrourl = url
|
||||
print(macrourl)
|
||||
|
||||
response = self.c.get(macrourl)
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
@@ -121,7 +123,7 @@ class TrainingPlanTest(TestCase):
|
||||
|
||||
for url in urls:
|
||||
if 'planbymonths' in url:
|
||||
print(url)
|
||||
|
||||
response = self.c.get(url,follow=True)
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
@@ -1872,6 +1874,29 @@ description: ""
|
||||
response = self.c.post(urlshare,form_data)
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
key = ShareKey.objects.create(pk=get_random_string(40),
|
||||
expiration_seconds=60,
|
||||
location=url
|
||||
)
|
||||
key.save()
|
||||
|
||||
url = '/rowers/access/'+key.token
|
||||
|
||||
response = self.c.get(url,follow=True)
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
@patch('rowers.garmin_stuff.requests.post', side_effect=mocked_requests)
|
||||
@patch('rowers.utils.requests.post', side_effect=mocked_requests)
|
||||
@patch('rowers.garmin_stuff.OAuth1Session', side_effect=MockOAuth1Session)
|
||||
def test_plannedsession_steps(self,mockpost,mock_post,MockOAuth1Session):
|
||||
self.ps_trimp.interval_string = '4x1000m'
|
||||
self.ps_trimp.save()
|
||||
|
||||
stepsdict = self.ps_trimp.steps['steps']
|
||||
self.assertEqual(len(stepsdict),2)
|
||||
|
||||
response = garmin_stuff.ps_to_garmin(self.ps_trimp,self.r)
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
|
||||
def test_plannedsessions_dateform_view(self):
|
||||
|
||||
Reference in New Issue
Block a user