vendredi 29 avril 2016

How do I setup a unit test user for django app? The unit test can't login

I've enabled login authentication for my django app. Unit tests for views are not working because they get stuck at the login page. Setting a breakpoint immediately after the view's response is returned and using

print response.content

results in output that contains the phrase 'please login'

How do I setup a user so the testcase can login? I've tried using my username and password, but it doesn't work in the unit test context.

Aucun commentaire:

Enregistrer un commentaire