Private
Public Access
1
0

removed tests of removed urls

This commit is contained in:
2024-03-25 21:31:08 +01:00
parent 02c998af3e
commit 892d6e4a83
8 changed files with 2 additions and 102 deletions

View File

@@ -315,7 +315,7 @@ def interactive_hr_piechart(df, rower, title, totalseconds=0):
'title': "HR "+ title
}
script, div = get_chart("/hrpie", chart_data, debug=True)
script, div = get_chart("/hrpie", chart_data)
return script, div
def pretty_timedelta(secs):

View File

@@ -1356,36 +1356,6 @@ class MarkerPerformanceTest(TestCase):
response = self.c.post(url,form_data)
self.assertEqual(response.status_code,200)
@patch('rowers.dataprep.create_engine')
@patch('rowers.dataprep.getsmallrowdata_db')
def test_ranking_view2(self, mocked_sqlalchemy,
mocked_getsmallrowdata_db):
login = self.c.login(username=self.u.username,password=self.password)
self.assertTrue(login)
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
url = reverse('rankings_view2')
response = self.c.get(url)
self.assertEqual(response.status_code,200)
form_data = {
'startdate':startdate.strftime("%Y-%m-%d"),
'enddate': enddate.strftime("%Y-%m-%d"),
'doform': True,
'dofatigue': True,
'metricchoice':'rscore',
'modelchoice': 'coggan',
'daterange': '',
}
form = DateRangeForm(form_data)
if not form.is_valid():
print(form.errors)
self.assertTrue(form.is_valid())
response = self.c.post(url,form_data)
self.assertEqual(response.status_code,200)
class AlertTest(TestCase):
def setUp(self):

View File

@@ -166,65 +166,3 @@ class CPChartTest(TestCase):
self.assertEqual(response.status_code,200)
@patch('rowers.dataprep.fetchcperg', side_effect = mocked_fetchcperg)
@patch('rowers.dataprep.create_engine')
def test_rankingpieces(self, mocked_fetchcperg, mocked_sqlalchemy):
url = '/rowers/ote-bests2/'
login = self.c.login(username=self.u.username,password=self.password)
self.assertTrue(login)
# update_records(url='rowers/tests/c2worldrecords.html',verbose=False)
form_data = {
'name': faker.word(),
'date': nu.date(),
'timezone': 'UTC',
'duration': '00:02:00.0',
'starttime': '10:01:43',
'distance': 500,
'workouttype': 'rower',
'boattype': '1x',
'weightcategory': 'hwt',
'adaptiveclass': 'None',
'notes': faker.text(),
'rankingpiece': True,
'duplicate': False,
'avghr': '160',
'avgpwr': 0,
'avgspm': 40,
}
url2 = '/rowers/workout/addmanual/'
response = self.c.post(url2, form_data, follow=True)
self.assertEqual(response.status_code, 200)
form_data['distance'] = 100
form_data['duration'] = '00:00:18.5'
response = self.c.post(url2, form_data, follow=True)
self.assertEqual(response.status_code, 200)
form_data['distance'] = 2000
form_data['duration'] = '00:06:56.5'
response = self.c.post(url2, form_data, follow=True)
self.assertEqual(response.status_code, 200)
form_data['distance'] = 5000
form_data['duration'] = '00:20:48.0'
response = self.c.post(url2, form_data, follow=True)
self.assertEqual(response.status_code, 200)
form_data['distance'] = 6000
form_data['duration'] = '00:22:17.6'
response = self.c.post(url2, form_data, follow=True)
self.assertEqual(response.status_code, 200)
form_data['distance'] = 10000
form_data['duration'] = '00:38:16.5'
response = self.c.post(url2, form_data, follow=True)
self.assertEqual(response.status_code, 200)
response = self.c.get(url)
self.assertEqual(response.status_code, 200)

View File

@@ -739,6 +739,6 @@ class InteractivePlotTests(TestCase):
workout = Workout.objects.filter(user=self.r,workouttype__in=mytypes.rowtypes)[0]
id = workout.id
script, div, js_res, css_res, comment = interactiveplots.interactive_flexchart_stacked(id,self.r)
script, div = interactiveplots.interactive_flexchart_stacked(id,self.r)
self.assertFalse(len(script)==0)
self.assertFalse(len(div)==0)

View File

@@ -74,10 +74,6 @@ class ViewTest(TestCase):
self.assertEqual(response.status_code, 200)
response = self.c.get('/rowers/workout/'+encoded1+'/histo/', form_data, follow=True)
self.assertEqual(response.status_code, 200)
f.close()

View File

@@ -122,8 +122,6 @@ class URLTests(TestCase):
'/rowers/me/workflowconfig2/',
'/rowers/me/workflowconfig2/user/1/',
'/rowers/me/workflowdefault/',
'/rowers/ote-bests2/',
'/rowers/ote-bests2/user/1/',
'/rowers/partners/',
'/rowers/physics/',
'/rowers/planrequired/',
@@ -155,7 +153,6 @@ class URLTests(TestCase):
'/rowers/workout/'+encoded1+'/flexchart/',
'/rowers/workout/'+encoded1+'/forcecurve/',
'/rowers/workout/'+encoded1+'/get-thumbnails/',
'/rowers/workout/'+encoded1+'/histo/',
'/rowers/workout/'+encoded1+'/image/',
'/rowers/workout/'+encoded1+'/instroke/',
'/rowers/workout/'+encoded1+'/interactiveotwplot/',

Binary file not shown.

View File

@@ -31,7 +31,6 @@
33,35,kill_async_job,kill job,TRUE,302,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,FALSE,FALSE,FALSE,
34,36,post_progress,post progress,TRUE,200,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,FALSE,FALSE,FALSE,
35,37,graphs_view,view charts,TRUE,302,basic,200,302,basic,200,302,coach,200,302,FALSE,TRUE,FALSE,TRUE,TRUE,
38,40,rankings_view2,view ranking,TRUE,302,pro,200,302,pro,403,302,coach,200,302,FALSE,TRUE,FALSE,TRUE,TRUE,
41,43,cum_flex,flex all chart,TRUE,200,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,FALSE,FALSE,FALSE,
42,44,analysis_view_data,redirects to analysis direct,TRUE,302,pro,200,302,pro,200,302,coach,200,302,FALSE,FALSE,FALSE,TRUE,TRUE,
43,47,cum_flex_data,flex all chart data (json),TRUE,200,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,FALSE,FALSE,FALSE,
1 id view function anonymous anonymous_response own own_response own_nonperm member member_response member_nonperm coachee coachee_response coachee_nonperm is_staff userid workoutid dotest realtest kwargs
31 33 35 kill_async_job kill job TRUE 302 basic 200 302 basic 200 302 coach 200 302 FALSE FALSE FALSE FALSE FALSE
32 34 36 post_progress post progress TRUE 200 basic 200 302 basic 200 302 coach 200 302 FALSE FALSE FALSE FALSE FALSE
33 35 37 graphs_view view charts TRUE 302 basic 200 302 basic 200 302 coach 200 302 FALSE TRUE FALSE TRUE TRUE
38 40 rankings_view2 view ranking TRUE 302 pro 200 302 pro 403 302 coach 200 302 FALSE TRUE FALSE TRUE TRUE
34 41 43 cum_flex flex all chart TRUE 200 basic 200 302 basic 200 302 coach 200 302 FALSE FALSE FALSE FALSE FALSE
35 42 44 analysis_view_data redirects to analysis direct TRUE 302 pro 200 302 pro 200 302 coach 200 302 FALSE FALSE FALSE TRUE TRUE
36 43 47 cum_flex_data flex all chart data (json) TRUE 200 basic 200 302 basic 200 302 coach 200 302 FALSE FALSE FALSE FALSE FALSE