def test_multi_put_model_with_existing_file(self):
emmen = Zoo(name='Wildlands Adventure Zoo Emmen')
with temp_imagefile(100, 200, 'jpeg') as file:
emmen.floor_plan.save('plan.jpg', File(file), save=False)
emmen.save()
model_data = {
'data': [{
'id': emmen.id,
'name': 'Wildlands!',
}]
}
response = self.client.put('/zoo/', data=json.dumps(model_data), content_type='application/json')
self.assertEqual(response.status_code, 200)
评论列表
文章目录