You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
USER STORY: As a Developer I can write code for automated tests in order to **accurately test my main code for bugs/issues and test criteria in order to refactor and test again.
Testing URL Resolution: All tests passed - see tests.py and run python3 manage.py test to run tests for yourself
Due to time constraints and complexity of the project, I did not complete any further automated tests
Manual Tests
Registration Form Submission (Register Page)
Test
Method
Expected Outcome
Result
Registration Form
Try to submit empty form
Form doesn't submit, and points to first field not filled in
Pass
Registration Form
Try to submit a form where a username already exists
Username is taken message will appear and reload register page
Pass
Remember me check box
Click on check box more than once
Blue tick shows when it is selected
Pass
Remember me check box
Remember me check box selected, close site and revisit
User is kept signed in on return
Pass
Email input
Try to enter an invalid email address or random numbers, words etc.
Email invalid message appears
Pass
Forget Password Link
Click on link
User is redirected to Reset Password page
Pass
Login link
Click on link
User is redirected to Login Page
Pass
Registration Form
Create a new user
Success message displays as user is redirected to Login Page
JSHint found an 'Undefinded Variable' in the form of 'e' in the base.js file, however, this is standard practice and I have found a supporting link to demonstrate this below.
At the time of writing/development of this project, the tried and tested PEP8 Python Validator was down. I mainly had to rely on the Linter that came with the Code Institute workspace that we use to start the portfolio projects. I did also use the https://www.pythonchecker.com/ site to test my code.
Results across all pages with Python code below:
File
Result
views.py
Pass*
models.py
Pass*
urls.py
Pass
helpers.py
Pass
forms.py
Pass
tests.py
Pass
"*" - This acknowledges and takes into account the known errors/warnings that come with the Gitpod Linter.
CLICK TO OPEN/HIDE PYTHON VALIDATION IMAGES
Current Python Errors/Issues/Explanations"
The Pylint and PEP8 checker on Gitpod is notoriously sensitive and flags warnings where they aren't necessary, see example below:
Pylint flags the 'token' argument as having no value, this is to be ignored as well, as per the SendGrid Documentation.
Ignoring any errors caused by using keywords such as id, pk, e, etc, which flags due to either warning about not being in snake case, or being reassigned a new value.
Import env issue in settings.py can be ignored
Several docstring warnings for imports, which can be ignored
The Password reset and change function's exceptions have to be passed with pass - otherwise the email password reset will not work. This is the same in helpers.py, where I have opted to print(e) instead. I trialled using message errors but it failed.
The only flake8 issues in the site now are relating to the settings.py standard settings, which I have not changed as it came from the django installation:
Lighthouse Performance Testing:
Lighthouse Testing was performed in an incognito tab to ensure no external chrome add-ons were affecting the test.
Results of the Lighthouse Performance testing below:
Tests on mulitple devices and browsers:
Browsers tested:
Google Chrome
Safari
Devices Tested on:
Apple Macbook Pro
Apple iPhone 12 Pro
Iphone X
HP laptop w/ Windows 11 installed
IPad Pro
Responsiveness:
The site has been tested down to screen widths of 300px up to screen sizes of 2560px
The site is fully responsive between these widths
Current Issues known but not yet resolved:
The responsiveness of the like and and comment icons on the blog cards in the post list aren't quite perfect. They will move inwards if a title is shorter than a certain number of characters. This will be addressed in a future update.
The like counter can take some time to load occasionally. However, I believe this is more of a connection issue rather than anything to do with my code.
In the Edit Post Management page, whilst using crisy forms, I am currently unable to render the current image link to the front end. When using {{ form.as_p }}, it seems to work perfectly, but then you lose the formatting that crispy forms provides. I will aim to address this in an update in future.
Titles cannot be too long at the moment, because it disrupts the css on some screen sizes - this will be fixed in future updates
Depending on resolution of images and wifi connectivity, speed of site loading can vary greatly. No known or scheduled fix for this.
As per above in the explanations for the python validation, I will find a new way if possible to implement a different way of using the Exception in the functions relating to sending emails and password resets in relation to the SendGrid API. Because the emailing system works exactly as it is now, and any alterations break this feature, I have decided the best way forward for now is to either use the Pass of Print(e) option in the exception. I reiterate though that I will try to implement a better means of the error handling if it's possible.
I did repeat myself a lot with the messages code at the top of most html templates - I did this as originally I considered doing the messages slightly differently of certain pages. In the end, I only made the messages slightly different on the Contact page. I will aim to make sure I don't repeat myself in the code in future updates.