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

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')]