From 360ad9631c8d23728a6f5618fda327ffd04e52bf Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 3 Apr 2023 12:28:51 +0530 Subject: [PATCH] UT: Fix AuthenticationService.needs_registration() tests --- .../authentication_service/test_authentication_service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/authentication_service/test_authentication_service.py b/monkey/tests/unit_tests/monkey_island/cc/services/authentication_service/test_authentication_service.py index 4dd5c3dde40..acf83d2d65e 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/services/authentication_service/test_authentication_service.py +++ b/monkey/tests/unit_tests/monkey_island/cc/services/authentication_service/test_authentication_service.py @@ -73,6 +73,7 @@ def authentication_facade( def test_needs_registration__true(authentication_facade: AuthenticationFacade): + authentication_facade._datastore.find_user.return_value = False assert authentication_facade.needs_registration() @@ -80,7 +81,7 @@ def test_needs_registration__false( monkeypatch, authentication_facade: AuthenticationFacade, ): - User(username=USERNAME, password=PASSWORD).save() + authentication_facade._datastore.find_user.return_value = True assert not authentication_facade.needs_registration()