- Add unit test for when case when the cookie doesn't match the db.

- Move code into User.signout method to further encapsulate the code.
This commit is contained in:
Rebecca Law
2020-02-03 15:08:55 +00:00
parent 937c9f2adc
commit 0e1ee504ac
3 changed files with 6 additions and 5 deletions

View File

@@ -61,6 +61,7 @@ def test_doesnt_redirect_to_sign_in_if_no_session_info(
@pytest.mark.parametrize('db_sess_id, cookie_sess_id', [
(None, None),
(None, uuid.UUID(int=1)), # BAD - cookie doesn't match db
(uuid.UUID(int=1), None), # BAD - has used other browsers before but this is a brand new browser with no cookie
(uuid.UUID(int=1), uuid.UUID(int=2)), # BAD - this person has just signed in on a different browser
])