-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix(prepush): adjusts pre-commit to run tests in shell #181
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a029749
docs(styling): tries possible option for code output
esparr e45c505
fix(prepush): reinstalling celery
esparr 1504d6f
fix(precommit): adjusting prepush test run
esparr 291a3d7
fix(prepush): adds shell for running tests
esparr 69302e0
chore(linting): clean up
esparr 365f334
chore: remove empty file
esparr 12e1b5c
docs: updates name of project
esparr 046091c
docs: remove renaming of app.
esparr 0d2e3a5
Merge branch 'staging' into chore/issue-167/prepush-precommit-docs
esparr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,15 @@ | |
from django.urls import reverse | ||
from rest_framework import status | ||
from rest_framework.test import APIClient | ||
|
||
from team_production_system.models import CustomUser | ||
|
||
|
||
class UserProfilePatchTestCase(TestCase): | ||
def setUp(self): | ||
self.client = APIClient() | ||
self.user = CustomUser.objects.create( | ||
username="baby_yoda", | ||
email="[email protected]", | ||
password="badpassword" | ||
username='baby_yoda', email='[email protected]', password='badpassword' | ||
) | ||
|
||
def test_new_user_gets_random_photo_assigned(self): | ||
|
@@ -22,14 +21,12 @@ def test_new_user_gets_random_photo_assigned(self): | |
def test_profile_photo_uploaded_first_time(self): | ||
# mock photo file | ||
photo = SimpleUploadedFile( | ||
"photo.jpg", | ||
b"this is a photo", | ||
content_type="image/jpeg" | ||
'photo.jpg', b'this is a photo', content_type='image/jpeg' | ||
) | ||
# Make a PATCH request to update the user profile with the new photo | ||
url = reverse("my-profile") | ||
url = reverse('my-profile') | ||
self.client.force_authenticate(user=self.user) | ||
response = self.client.patch(url, {"profile_photo": photo}) | ||
response = self.client.patch(url, {'profile_photo': photo}) | ||
|
||
# Check that the response status code is 200 OK | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
|
@@ -43,15 +40,13 @@ def test_previous_file_deleted_when_new_photo_saved(self): | |
old_photo_name = self.user.profile_photo.name | ||
# Create a new profile photo file | ||
new_photo = SimpleUploadedFile( | ||
"new_photo.jpg", | ||
b"this is a new photo", | ||
content_type="image/jpeg" | ||
'new_photo.jpg', b'this is a new photo', content_type='image/jpeg' | ||
) | ||
|
||
# Make a PATCH request to update the user profile with the new photo | ||
url = reverse("my-profile") | ||
url = reverse('my-profile') | ||
self.client.force_authenticate(user=self.user) | ||
response = self.client.patch(url, {"profile_photo": new_photo}) | ||
response = self.client.patch(url, {'profile_photo': new_photo}) | ||
|
||
# Check that the response status code is 200 OK | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@GitLukeW During the process of debugging, I uninstalled and reinstalled celery. When I did this, I also ran pipenv install and it looks like it updated boto3 as well. Do you think this is going to cause an issue? If so I can work on reverting it.