-
Notifications
You must be signed in to change notification settings - Fork 39
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
Flush session on logout #2828
Flush session on logout #2828
Conversation
This needs some changes to testing and additional tests, so ill let it wait until #2813 is done, as that adds some useful test additions |
83b5498
to
8b9a98c
Compare
takes a request and clears everything session related from it
d5d2595
to
149b11b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2828 +/- ##
==========================================
+ Coverage 57.15% 57.18% +0.02%
==========================================
Files 568 568
Lines 41282 41301 +19
==========================================
+ Hits 23596 23617 +21
+ Misses 17686 17684 -2 ☔ View full report in Codecov by Sentry. |
149b11b
to
67679a4
Compare
2d5519e
to
ce85442
Compare
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 functionality changes here seem fine (have not tested manually, yet), however, I have objections to the way the tests have been reorganized.
We try to adhere to a pattern where test modules are named after the Python modules they are testing. These modules do not exist in NAV, yet the new test modules seem to indicate they exist:
nav.web.auth.ensure_account
nav.web.auth.logout
If you have a need to group multiple tests for a single function or class (or group of co-operating functions), I find it's better to group those tests as methods in a class.
E.g.
class TestFoobar:
def test_when_color_is_green_it_should_return_ok_status(self ...):
...
Something like this would tell me the function or functionality under test is Foobar, and the test names tell me something about which conditions are being tested and which behaviors are expected
.
Quality Gate passedIssues Measures |
Instead of deleting stuff from session manually, use
flush
function instead. This is how Django does stuff internally.Also puts the code into its own function so it isnt spread several places
Makes changes that are awkward to test in unit tests, so some tests have been ported to integration tests
related to #2804