diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/auth/test_register.py b/monkey/tests/unit_tests/monkey_island/cc/resources/auth/test_register.py index 67d7478d9..49419ee4f 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/resources/auth/test_register.py +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/auth/test_register.py @@ -62,12 +62,3 @@ def test_internal_error(make_registration_request, mock_authentication_service): response = make_registration_request(registration_request_body) assert response.status_code == 500 - - -@pytest.mark.parametrize("needs_registration", [True, False]) -def test_needs_registration(flask_client, mock_authentication_service, needs_registration): - mock_authentication_service.needs_registration = MagicMock(return_value=needs_registration) - response = flask_client.get(REGISTRATION_URL, follow_redirects=True) - - assert response.status_code == 200 - assert response.json["needs_registration"] is needs_registration diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/auth/test_registration_status.py b/monkey/tests/unit_tests/monkey_island/cc/resources/auth/test_registration_status.py new file mode 100644 index 000000000..350590df8 --- /dev/null +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/auth/test_registration_status.py @@ -0,0 +1,16 @@ +from unittest.mock import MagicMock + +import pytest + +from monkey_island.cc.resources.auth.registration_status import RegistrationStatus + +REGISTRATION_STATUS_URL = RegistrationStatus.urls[0] + + +@pytest.mark.parametrize("needs_registration", [True, False]) +def test_needs_registration(flask_client, mock_authentication_service, needs_registration): + mock_authentication_service.needs_registration = MagicMock(return_value=needs_registration) + response = flask_client.get(REGISTRATION_STATUS_URL, follow_redirects=True) + + assert response.status_code == 200 + assert response.json["needs_registration"] is needs_registration