Changed db queries to use one, which throws NoResultFound exception, this exception is dealt with in our error handlers.

Now a lot of the if none checks can be removed.
This commit is contained in:
Rebecca Law
2016-03-11 12:39:55 +00:00
parent 209244ff19
commit e055590b07
19 changed files with 66 additions and 112 deletions

View File

@@ -1,5 +1,7 @@
from datetime import datetime, timedelta
from sqlalchemy.exc import DataError
from sqlalchemy.orm.exc import NoResultFound
from app import db
import pytest
@@ -55,7 +57,7 @@ def test_get_user_not_exists(notify_api, notify_db, notify_db_session):
try:
get_model_users(user_id="12345")
pytest.fail("NoResultFound exception not thrown.")
except:
except NoResultFound as e:
pass