-
Notifications
You must be signed in to change notification settings - Fork 1
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
Merge sessions into integration🎉🎊 #19
Conversation
Commit for common code base
Commented out attempt to use native functions
using GQ ctx version over overwriting sessions handler Conflicts: app.py components/handlers/index.py components/handlers/login.py
…dded basic session authentication:
could login by running 'document.cookie="user=<any value>" in console
users could re-access a logged out account by entering 'document.cookie="user=<logged out user>' before the tab was closed.
@helloqx |
@nlzz22 oh ya one thing i forgot to note: modified modules doesnt have test cases |
@helloqx Test cases for UI? |
For not crashing (root.status == 200) |
@helloqx I was about to write the UI test cases after checking if Modified Modules needs any more changes for UI side. You have a base test case for that already? |
I only have a 3 lines status == 200 test but haven't pushed, just write over ba |
Conflicts: app.py components/handlers/outcome.py components/model.py
…n from html handler
raise web.seeother('/login') | ||
input_data = web.input() | ||
module_code = input_data.code | ||
module_info = model.get_module(module_code) | ||
if module_info is None: |
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.
this means that it can't find the module right, so it's taking care of the instance where one user deletes a module and another user tries to view it at the same time?
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.
Yes, no.
It prevents the site from crashing when user accesses wrong module code
raise web.seeother('/login') | ||
|
||
input_data = web.input() | ||
module_code = input_data.code | ||
module_info = model.get_module(module_code) | ||
if module_info is None: |
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.
the 404 page is used in a few pages, would adding an error message be a good idea? is it going to be used in the final production?
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.
No, 404 is a temporary page
test/test_view_individual_module.py
Outdated
@@ -3,7 +3,8 @@ | |||
''' | |||
from paste.fixture import TestApp | |||
from nose.tools import assert_equal, raises |
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.
unused raises
delete_dummy_user_for_tests() | ||
create_dummy_user_for_tests() | ||
login_session_for_tests(test_app) | ||
|
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.
please use 2 newlines between functions
assert_equal(redirected.status, 200) | ||
# checks if Validating page loaded | ||
response.mustcontain(self.VALIDATING_TITLE) | ||
assert_equal(response.status, 200) | ||
|
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.
why is here a assert_equal(response.status, 200)
instead of the assert_equal(response.status, 303)
we had previously?
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.
Outcome() is loaded now instead of redirecting back to /login with error code
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.
All files are linted as per comments given, passed all test cases. Session functions as intended.
All automated testcases passed, no errors found on deployed version through manual testing. sessions functions as intended. Pending test: 2 more more people logging in at the same time. |
2 or more people logging in testing done. all behavior as expected. Pull request approved. |
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.
All automated testcases passed, no errors found on deployed version through manual testing. sessions functions as intended.
Finally, issue #12 is resolved (hopefully) by our very own handler🎉 .
Some points: