Noticed that the api was being called when running the unit tests.

This also lead me to find the the failed_login_in count was always returning 0.
This commit is contained in:
Rebecca Law
2016-03-11 11:47:21 +00:00
parent f81dccc513
commit 58c748e703
3 changed files with 2 additions and 19 deletions

View File

@@ -401,12 +401,7 @@ def mock_get_user_by_email_locked(mocker, api_user_locked):
@pytest.fixture(scope='function')
def mock_get_user_by_email_inactive(mocker, api_user_pending):
def _get_user(email_address):
api_user_pending._email_address = email_address
api_user_pending._is_locked = True
return api_user_pending
return mocker.patch('app.user_api_client.get_user_by_email', side_effect=_get_user)
return mocker.patch('app.user_api_client.get_user_by_email', return_value=api_user_pending)
@pytest.fixture(scope='function')