Friday, April 23, 2021

Re: Testing Django User Login Form

Thank you for the reply!  I will totally try this tonight!

On Thursday, April 22, 2021 at 7:31:40 PM UTC-4 David Nugent wrote:
Try creating a request using RequestFactory and use that to input the credentials. I don't think the way you are creating the form is valid.

rf = RequestFactory()
request = rf.post('/some_mock_url', dict(username='abc', password='password'))
form = AuthenticationForm(request)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e3079f83-6175-4852-9a6a-f94625079af4n%40googlegroups.com.

No comments:

Post a Comment