-
Notifications
You must be signed in to change notification settings - Fork 464
refactor tests into pytest #893
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #893 +/- ##
=======================================
Coverage 98.66% 98.67%
=======================================
Files 27 27
Lines 902 908 +6
=======================================
+ Hits 890 896 +6
Misses 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just some minor comments.
response = self._get_view_response(request, provider="facebook") | ||
assert response.status_code == status.HTTP_400_BAD_REQUEST | ||
|
||
def test_post_facebook_provider_auth_unknown_error(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the code for all 3 tests is the same, I would do a test generator or anything to decrease the amount of test code to read / maintain
request = self.factory.post("/auth/facebook/") | ||
request.GET = data | ||
response = self._get_view_response(request, provider="facebook") | ||
assert response.status_code == status.HTTP_400_BAD_REQUEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
self.signal_sent = False | ||
self.base_url = reverse("login") | ||
@pytest.mark.django_db | ||
class TestTokenCreateView: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why there is some inconsistency when it comes to grouping tests in classes like here, or not like in e.g. test_password_reset.py
.
No description provided.