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)
评论列表
文章目录