@@ -144,10 +144,31 @@ def test_update_done(self):
144
144
145
145
result = self .app .get ('/job/read' )
146
146
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 )
151
172
152
173
def test_insert_urgency_4 (self ):
153
174
rv = self .app .post ('/job/create' , data = {
0 commit comments