Private
Public Access
1
0

coverage info

This commit is contained in:
Sander Roosendaal
2021-04-14 17:42:12 +02:00
parent aa2315cb9b
commit 39a196b949
6 changed files with 232 additions and 425 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -575,10 +575,7 @@ race 1
self.assertIn('Successfully processed email attachments',out.getvalue())
ws = Workout.objects.filter(name="johnsworkout")
if not len(ws):
for w in Workout.objects.all():
print(w)
self.assertEqual(len(ws),1)
w = ws[0]

View File

@@ -63,15 +63,6 @@ class InteractiveChartTest(TestCase):
mocked_getsmallrowdata_db):
res = iplots.interactive_chart(self.wote.id,promember=1)
@patch('rowers.dataprep.create_engine')
@patch('rowers.dataprep.read_df_sql')
def test_interactive_chart3(self, mocked_sqlalchemy,mocked_read_df_sql):
res = iplots.interactive_bar_chart(self.wote.id)
@patch('rowers.dataprep.create_engine')
@patch('rowers.dataprep.read_df_sql')
def test_interactive_chart4(self, mocked_sqlalchemy,mocked_read_df_sql):
res = iplots.interactive_bar_chart(self.wote.id,promember=1)
@patch('rowers.dataprep.create_engine')
@patch('rowers.dataprep.read_df_sql')

View File

@@ -234,10 +234,6 @@ class PermissionsViewTests(TestCase):
mocked_get_video_data,
):
print()
print(view,'anonymous',permissions['anonymous'],permissions['is_staff'],permissions['dotest'])
print()
if permissions['anonymous'] and not permissions['is_staff'] and permissions['dotest']:
urlstotest = []
if permissions['workoutid']:
@@ -247,8 +243,6 @@ class PermissionsViewTests(TestCase):
url = reverse(view)
urlstotest.append(url)
print(view,'anonymous',urlstotest)
for url in urlstotest:
result = self.c.get(url)
self.assertEqual(result.status_code,permissions['anonymous_response'])
@@ -275,10 +269,6 @@ class PermissionsViewTests(TestCase):
mocked_get_video_data,
):
print()
print(view,'own')
print()
if permissions['own'] in plans and not permissions['is_staff'] and permissions['dotest']:
urlstotest = []
falseurlstotest = []
@@ -288,8 +278,6 @@ class PermissionsViewTests(TestCase):
memberuser = self.uplan
notuser = None
print(view,'own')
if permissions['own'] == 'basic':
thisuser = self.ubasic
memberuser = self.uplan
@@ -323,8 +311,6 @@ class PermissionsViewTests(TestCase):
url = reverse(view)
urlstotest.append(url)
print(view,'own',urlstotest,falseurlstotest,otheruserurls)
# test logged in as user who has permissions
for url in urlstotest:
login = self.c.login(username = thisuser['username'],password = thisuser['password'])
@@ -365,10 +351,6 @@ class PermissionsViewTests(TestCase):
mocked_get_video_data,
):
print()
print(view,'member')
print()
if permissions['member'] in plans and permissions['is_staff'] is False and permissions['dotest']:
urlstotest = []
falseurlstotest = []
@@ -378,8 +360,6 @@ class PermissionsViewTests(TestCase):
memberuser = self.uplan
notuser = None
print(view,'member')
if permissions['member'] == 'basic':
thisuser = self.ubasic
memberuser = self.uplan
@@ -414,8 +394,6 @@ class PermissionsViewTests(TestCase):
url = reverse(view)
urlstotest.append(url)
print('member',urlstotest,falseurlstotest,otheruserurls)
# test logged in as user who has permissions
for url in urlstotest:
login = self.c.login(username = thisuser['username'],password = thisuser['password'])
@@ -456,10 +434,6 @@ class PermissionsViewTests(TestCase):
mocked_get_video_data,
):
print()
print(view,'coachee')
print()
if permissions['coachee'] in plans and not permissions['is_staff'] and permissions['dotest']:
urlstotest = []
falseurlstotest = []
@@ -486,8 +460,6 @@ class PermissionsViewTests(TestCase):
url = reverse(view)
urlstotest.append(url)
print('coachee',urlstotest,falseurlstotest,otheruserurls)
# test logged in as user who has permissions
for url in urlstotest:
login = self.c.login(username = thisuser['username'],password = thisuser['password'])

View File

@@ -83,6 +83,10 @@ class TrainingPlanTest(TestCase):
response = self.c.get(urlplan)
self.assertEqual(response.status_code,200)
url = reverse('rower_trainingplan_execution_view',kwargs={'id':1})
response = self.c.get(url)
self.assertEqual(response.status_code,200)
html = BeautifulSoup(response.content,'html.parser')
urls = [a['href'] for a in html.find_all('a')]

View File

@@ -1951,7 +1951,7 @@ def workouts_view(request,message='',successmessage='',
if request.method == 'POST':
dateform = DateRangeForm(request.POST)
searchform = SearchForm(request.POST)
if dateform.is_valid():
if dateform.is_valid(): # pragma: no cover
startdate = dateform.cleaned_data['startdate']
enddate = dateform.cleaned_data['enddate']
if searchform.is_valid():
@@ -1986,7 +1986,7 @@ def workouts_view(request,message='',successmessage='',
activity_enddate = activity_enddate.replace(hour=23,minute=59,second=59).astimezone(usertimezone)
activity_startdate = activity_enddate-datetime.timedelta(days=15)
activity_startdate = activity_startdate.replace(hour=0,minute=0,second=0)
else:
else: # pragma: no cover
activity_enddate = enddate
except (ValueError, AttributeError): # pragma: no cover
activity_enddate = enddate
@@ -2064,7 +2064,7 @@ def workouts_view(request,message='',successmessage='',
workouts = workouts.exclude(rankingpiece=False)
workoutsnohr = workouts.exclude(averagehr__isnull=False)
for w in workoutsnohr:
for w in workoutsnohr: # pragma: no cover
res = dataprep.workout_trimp(w)
# ids = [w.id for w in workouts]