test_subquota_view.py 文件源码

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

项目:jarbas 作者: datasciencebr 项目源码 文件源码
def test_contents(self):
        expected = [
            dict(subquota_description='Another subquota', subquota_id=42),
            dict(subquota_description='Subquota description', subquota_id=4)
        ]

        cache.clear()
        secondary_data = sample_reimbursement_data.copy()
        secondary_data['document_id'] = 13
        secondary_data['year'] = 1971
        secondary_data['subquota_id'] = 42
        secondary_data['subquota_description'] = 'Another subquota'
        Reimbursement.objects.create(**secondary_data)
        resp = self.client.get(self.url)

        content = loads(resp.content.decode('utf-8'))
        self.assertEqual(2, content['count'])
        self.assertEqual(expected, content['results'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号