django-rest-auth icon indicating copy to clipboard operation
django-rest-auth copied to clipboard

Adds test support for Django>=2.1

Open magnunleno opened this issue 7 years ago • 4 comments

Replaces deprecated FBVs for the new standard CBVs.

Since Django 2.1 the following FBVs were dropped from contrib.auth.views:

  • logout()
  • password_reset()
  • password_reset_confirm()
  • password_change()

magnunleno avatar Oct 27 '18 05:10 magnunleno

@magnunleno Thanks for the PR. I think since the minimum required django version supports CBV anyways, we can skip the FBV part and version check completely.

Also please notice there are other places apart from tests, where the same FBV are used e.g.: https://github.com/Tivix/django-rest-auth/blob/master/rest_auth/views.py#L1

Could you please make all the necessary changes?

mariodev avatar Feb 03 '19 18:02 mariodev

Sure! I'll remove the version checking.

But the login and logout functions imported in rest_auth/views.py aren't actually views, but helpers that "registers" in the session that the user is logged in/logged out. They aren't deprecated and will probably remain used for a long time: https://github.com/django/django/blob/master/django/contrib/auth/init.py#L87

magnunleno avatar Feb 07 '19 01:02 magnunleno

Coverage Status

Coverage increased (+0.003%) to 96.369% when pulling 38d5d6f34b1706554a3ada960f4c72f8d7228604 on magnunleno:fix/add-test-support-for-django-2.1 into 479a40d2ccd69d69f7a05d716f30239dd3ef2343 on Tivix:master.

coveralls avatar Feb 07 '19 01:02 coveralls

Hi, as a user of rest-auth, thanks for the contribution! This repo is not maintained anymore, so the development moved to dj-rest-auth. (reference: https://github.com/Tivix/django-rest-auth/issues/568) It may be best, if you move this PR there. (and upgrade to using dj_rest_auth)

new repo link: https://github.com/jazzband/dj-rest-auth (I'm not the upkeeper of that repo, it just makes sense for me to help you merge your PR)

Many Thanks, Barney

BarnabasSzabolcs avatar May 30 '20 01:05 BarnabasSzabolcs