added test for upload of logcard
This commit is contained in:
@@ -671,6 +671,34 @@ class ViewTest(TestCase):
|
||||
f_to_be_deleted = w.csvfilename
|
||||
os.remove(f_to_be_deleted+'.gz')
|
||||
|
||||
def test_upload_view_logcard(self):
|
||||
self.c.login(username='john',password='koeinsloot')
|
||||
|
||||
filename = 'rowers/testdata/logcard.csv'
|
||||
f = open(filename,'rb')
|
||||
file_data = {'file': f}
|
||||
form_data = {
|
||||
'title':'',
|
||||
'workouttype':'rower',
|
||||
'notes':'aap noot mies',
|
||||
'make_plot':False,
|
||||
'upload_to_c2':False,
|
||||
'plottype':'timeplot',
|
||||
'file': f,
|
||||
}
|
||||
|
||||
form = DocumentsForm(form_data,file_data)
|
||||
|
||||
response = self.c.post('/rowers/workout/upload/', form_data, follow=True)
|
||||
|
||||
f.close()
|
||||
|
||||
self.assertRedirects(response, expected_url='/rowers/workout/upload/This%20C2%20logbook%20summary%20does%20not%20contain%20stroke%20data.%20Please%20download%20the%20Export%20Stroke%20Data%20file%20from%20the%20workout%20details%20on%20the%20C2%20logbook.',
|
||||
status_code=302,target_status_code=200)
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_upload_view_TCX_CN(self):
|
||||
|
||||
Reference in New Issue
Block a user