AccountTests.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:mltshp 作者: MLTSHP 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号