Skip to content

Commit 6829c79

Browse files
committed
update acknowledged and update done pass
1 parent 98bca6a commit 6829c79

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

app_test.py

+25-4
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,31 @@ def test_update_done(self):
144144

145145
result = self.app.get('/job/read')
146146
data = json.loads(result.data.decode('utf-8'))
147-
print(data)
148-
# self.assertEqual(data['jobs'][0]['id'], 1)
149-
# print(data['jobs'][0]['done'])
150-
# self.assertEqual(type(data['jobs'][0]['done']), datetime)
147+
self.assertEqual(data, {'jobs': []})
148+
149+
def test_update_acknowledged(self):
150+
self.app.post('/job/create', data={
151+
'team_id': 10,
152+
'patient_id': 'patient_id',
153+
'urgency': 3,
154+
'creator_comment': 'creator_comment',
155+
'doctor_comment': 'doctor_comment',
156+
'bed': 'bed',
157+
'ward': 'ward',
158+
'location': 'location',
159+
'creator_name': 'creator_name'
160+
}, follow_redirects=True)
161+
162+
up = self.app.post('/job/update/1', data={
163+
'acknowledged': 'Sun May 15 2016 12:17:36 GMT+0100 (BST)'
164+
}, follow_redirects=True)
165+
166+
self.assertEqual(json.loads(up.data.decode('utf-8'))['success'], True)
167+
168+
result = self.app.get('/job/read')
169+
data = json.loads(result.data.decode('utf-8'))
170+
self.assertEqual(data['jobs'][0]['id'], 1)
171+
self.assertEqual(type(data['jobs'][0]['acknowledged']), str)
151172

152173
def test_insert_urgency_4(self):
153174
rv = self.app.post('/job/create', data={

0 commit comments

Comments
 (0)