def test_clears_all_saves(self):
self.upload_file(self.test_file1_path, self.test_file1_sha1, self.test_file1_content_type, 1, self.receiver_sid, self.xsrf)
sharedfile = Sharedfile.get('id=1')
n = Notification.new_save(self.sender, sharedfile)
n = Notification.new_save(self.sender, sharedfile)
request = HTTPRequest(self.get_url('/account/clear-notification'), 'POST', {'Cookie':'_xsrf=%s;sid=%s' % (self.xsrf, self.receiver_sid)}, '_xsrf=%s&type=save' % (self.xsrf))
self.http_client.fetch(request, self.stop)
response = self.wait()
j = json_decode(response.body)
self.assertEqual(j['response'], "0 new saves")
ns = Notification.where('receiver_id=%s' % (self.receiver.id))
for n in ns:
self.assertTrue(n.deleted)
评论列表
文章目录