AccountTests.py 文件源码

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

项目:mltshp 作者: MLTSHP 项目源码 文件源码
def test_pagination_returns_correct_counts(self):
        """
        This tests creating 111 shared files for a user and then tests that pagination
        on their user page returns the correct pages
        """
        user = User.get('name="admin"')
        user_shake = user.shake()
        source_file = Sourcefile(width=10, height=10, file_key='mumbles', thumb_key='bumbles')
        source_file.save()

        missing_ids = []

        for i in range(111):
            sf = Sharedfile(source_id = source_file.id, user_id = user.id, name="shgaredfile.png", title='shared file', share_key='asdf', content_type='image/png', deleted=0)  
            sf.save()
            sf.add_to_shake(user_shake)

        for i in range(12):
            response = self.fetch('/user/admin/%s' % (i + 1))
            self.assertEqual(response.code, 200)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号