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