0
我正在爲我的應用視圖編寫覆蓋率測試用例。我使用了modelform的Createview和Updateview類,並使用get_success_url()
進行響應重定向。創建視圖類和更新視圖類的覆蓋率測試
當我使用self.client.post('/product/add/', data)
傳遞表單的數據時,響應爲TemplateResponse,status_code爲200,但get_success_url()
語句未被測試用例覆蓋。那麼我怎樣才能從TemplateResponse填寫表單並提交呢?
感謝您的快速響應。 –