Skip to content

Commit

Permalink
Upate FakeSession
Browse files Browse the repository at this point in the history
have to mock away the cycle_key thingy else existing tests
fail. Will probably need separate integration tests to test
session ID cycling
  • Loading branch information
stveit committed Feb 21, 2024
1 parent 6c74a1f commit fb59be6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/unittests/general/web_middleware_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def set_expiry(self, *_):
def save(self, *_):
pass

def cycle_key(self, *_):
pass


def test_set_account():
r = RequestFactory()
Expand Down
3 changes: 3 additions & 0 deletions tests/unittests/general/webfront_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def set_expiry(self, *_):
def save(self, *_):
pass

def cycle_key(self, *_):
pass


@patch("nav.web.auth.Account.save", new=MagicMock(return_value=True))
@patch("nav.web.auth.Account.objects.get", new=MagicMock(return_value=LDAP_ACCOUNT))
Expand Down

0 comments on commit fb59be6

Please sign in to comment.