Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle DRF 3.9+ breaking change #7

Merged
merged 19 commits into from
May 12, 2021
Merged

Conversation

wimkeir
Copy link
Contributor

@wimkeir wimkeir commented May 12, 2021

DRF decided to change the base_name argument to basename around v3.9, which means the call to router.register was throwing a TypeError on projects using higher DRF versions.

This should have been a small update, but the unit tests became a nightmare and had to be overhauled.

  • Need to use force_authenticate instead of client.login in the view and user tests
  • We no longer support Django 1, although moving past v2.1 still seems to break the tests, so we pin it to <2.1 for now
  • We no longer test on Python 2.7 or PyPy, and upgrade from Python 3.5 to 3.7
  • Tox is ditched entirely - this bug made working with tests on Travis a nightmare and since we're only testing on Python 3.7 now it was no longer necessary

@wimkeir wimkeir requested a review from ruands May 12, 2021 13:26
Copy link

@ruands ruands left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Wim!

@@ -68,7 +68,7 @@ def test_anonymous_get_user(self):
self.assertEqual(response.status_code, 403)

def test_superuser_create_user(self):
self.client.login(username="superuser", password="password")
self.client.force_authenticate(self.superuser)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's new 👍

@wimkeir wimkeir merged commit 682ed5f into develop May 12, 2021
@wimkeir wimkeir deleted the feature/support-drf-3.9+ branch May 12, 2021 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants