Private
Public Access
1
0
This commit is contained in:
2023-11-18 14:59:18 +01:00
parent 56b307eb64
commit b3af3d1280
4 changed files with 36 additions and 6 deletions

View File

@@ -181,6 +181,30 @@ class OwnApi(TestCase):
self.assertEqual(response.status_code,200)
def test_strokedataform_tcx(self):
login = self.c.login(username=self.u.username, password=self.password)
self.assertTrue(login)
w = self.user_workouts[1]
url = reverse('strokedata_tcx')
with open('rowers/tests/testdata/crewnerddata.tcx') as f:
tcxdata_str = f.read()
result = get_random_file(filename='rowers/tests/testdata/thyro.csv')
request = self.factory.post(url, data = tcxdata_str, content_type='application/xml')
request.user = self.u
request.content_type = 'application/xml'
force_authenticate(request, user=self.u)
with patch('rowers.dataprep.getrowdata_db') as mock_getrowdata:
mock_getrowdata.return_value = (pd.DataFrame(),None)
response = strokedata_tcx(request)
self.assertEqual(response.status_code,200)
def test_strokedataform_v3(self):
login = self.c.login(username=self.u.username, password=self.password)
self.assertTrue(login)