django - Coverage test for create view class and update view class -


i'm writing coverage test cases app views. have used createview , updateview classes modelform , used get_success_url() response redirect.

when passed data form using self.client.post('/product/add/', data), response templateresponse , status_code 200, get_success_url() statements not covered test case. how can fill , submit form templateresponse?

if client not redirecting success url, data invalid. can access form through response's context, , check errors:

print response.context['form'].errors 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -