Private
Public Access
1
0

warning wednesday

This commit is contained in:
Sander Roosendaal
2021-12-15 10:50:00 +01:00
parent df9744e5b3
commit 06d64b1d05
5 changed files with 76 additions and 28 deletions

View File

@@ -73,7 +73,9 @@ class GarminObjects(DjangoTestCase):
w.delete()
def test_garmin_push_summaries(self):
data = json.load(open('rowers/tests/testdata/garminsummarydata.txt','r'))
with open('rowers/tests/testdata/garminsummarydata.txt','r') as f:
data = json.load(f)
response = self.c.post('/rowers/garmin/summaries/',json.dumps(data),
content_type="application/json")
self.assertEqual(response.status_code, 200)
@@ -85,7 +87,8 @@ class GarminObjects(DjangoTestCase):
self.assertEqual(ws.count(),3)
def test_garmin_push_details3(self):
data = json.load(open('rowers/tests/testdata/garmindetail3.txt','r'))
with open('rowers/tests/testdata/garmindetail3.txt','r') as f:
data = json.load(f)
response = self.c.post('/rowers/garmin/activities/',json.dumps(data),
content_type='application/json')
@@ -99,7 +102,8 @@ class GarminObjects(DjangoTestCase):
self.assertEqual(len(data),515)
def test_garmin_push_details4(self):
data = json.load(open('rowers/tests/testdata/garmindetail4.txt','r'))
with open('rowers/tests/testdata/garmindetail4.txt','r') as f:
data = json.load(f)
response = self.c.post('/rowers/garmin/activities/',json.dumps(data),
content_type='application/json')
@@ -113,7 +117,8 @@ class GarminObjects(DjangoTestCase):
self.assertEqual(len(data),18)
def test_garmin_push_details2(self):
data = json.load(open('rowers/tests/testdata/garmindetail2.txt','r'))
with open('rowers/tests/testdata/garmindetail2.txt','r') as f:
data = json.load(f)
response = self.c.post('/rowers/garmin/activities/',json.dumps(data),
content_type='application/json')
@@ -126,7 +131,8 @@ class GarminObjects(DjangoTestCase):
self.assertEqual(len(data),451)
def test_garmin_push_details1(self):
data = json.load(open('rowers/tests/testdata/garmindetail1.txt','r'))
with open('rowers/tests/testdata/garmindetail1.txt','r') as f:
data = json.load(f)
response = self.c.post('/rowers/garmin/activities/',json.dumps(data),
content_type='application/json')