M
M
mkone1122020-11-27 01:31:17
Django
mkone112, 2020-11-27 01:31:17

How to test view with @login_required?

I don't understand how to test the simplest view

@login_required
def dashboard(request):
    return render(request, 'account/dashboard.html', {'section': 'dashboard'})

All my attempts end with a redirect to the login page.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-11-27
@bacon

ok google, "django test login required"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question