added permissions in analysis views
This commit is contained in:
@@ -841,6 +841,8 @@ class PermissionsViewTests(TestCase):
|
||||
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
|
||||
|
||||
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multistats)
|
||||
def test_coach_edit_athlete_analysis_not(self,mocked_df):
|
||||
self.rbasic.team.add(self.teamcoach)
|
||||
@@ -851,7 +853,7 @@ class PermissionsViewTests(TestCase):
|
||||
|
||||
url = reverse('cumstats',
|
||||
kwargs={
|
||||
'theuser':self.ubasic.id,
|
||||
'userid':self.ubasic.id,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -859,6 +861,24 @@ class PermissionsViewTests(TestCase):
|
||||
|
||||
self.assertEqual(response.status_code,403)
|
||||
|
||||
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multistats)
|
||||
def test_coach_edit_athlete_analysis_not2(self,mocked_df):
|
||||
self.rbasic.team.add(self.teamcoach)
|
||||
|
||||
login = self.c.login(username=self.ucoach.username, password=self.ucoachpassword)
|
||||
self.assertTrue(login)
|
||||
|
||||
|
||||
url = reverse('analysis_new',
|
||||
kwargs={
|
||||
'userid':self.ubasic.id,
|
||||
}
|
||||
)
|
||||
|
||||
response = self.c.get(url)
|
||||
|
||||
self.assertEqual(response.status_code,403)
|
||||
|
||||
|
||||
## Coach can upload on behalf of athlete - if team allows
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
|
||||
@@ -5,7 +5,8 @@ from __future__ import unicode_literals
|
||||
|
||||
#from __future__ import print_function
|
||||
from .statements import *
|
||||
nu = datetime.datetime.now()self.ucoach = UserFactory()
|
||||
nu = datetime.datetime.now()
|
||||
self.ucoach = UserFactory()
|
||||
self.rcoach = Rower.objects.create(
|
||||
user=self.ucoach,
|
||||
birthdate=faker.profile()['birthdate'],
|
||||
|
||||
Reference in New Issue
Block a user