diff --git a/shell.py b/shell.py index 5fbabf25..6cee5fec 100644 --- a/shell.py +++ b/shell.py @@ -140,7 +140,7 @@ app = create_app() with app.app_context(): # to test email template # with open("/tmp/email.html", "w") as f: - # user = User.get(1) + # user = User.first() # f.write( # render( # "transactional/reset-password.html", diff --git a/tests/api/test_auth_login.py b/tests/api/test_auth_login.py index 01df3f3f..3ebda76c 100644 --- a/tests/api/test_auth_login.py +++ b/tests/api/test_auth_login.py @@ -79,7 +79,7 @@ def test_auth_login_device_exist(flask_client): def test_auth_register_success(flask_client): - assert AccountActivation.get(1) is None + assert AccountActivation.first() is None r = flask_client.post( url_for("api.auth_register"), @@ -90,7 +90,7 @@ def test_auth_register_success(flask_client): assert r.json["msg"] # make sure an activation code is created - act_code = AccountActivation.get(1) + act_code = AccountActivation.first() assert act_code assert len(act_code.code) == 6 assert act_code.tries == 3 @@ -116,7 +116,7 @@ def test_auth_activate_success(flask_client): assert r.json["msg"] # get the activation code - act_code = AccountActivation.get(1) + act_code = AccountActivation.first() assert act_code assert len(act_code.code) == 6 @@ -156,7 +156,7 @@ def test_auth_activate_wrong_code(flask_client): assert r.json["msg"] # get the activation code - act_code = AccountActivation.get(1) + act_code = AccountActivation.first() assert act_code assert len(act_code.code) == 6 assert act_code.tries == 3 @@ -171,7 +171,7 @@ def test_auth_activate_wrong_code(flask_client): assert r.status_code == 400 # make sure the nb tries decrements - act_code = AccountActivation.get(1) + act_code = AccountActivation.first() assert act_code.tries == 2 @@ -185,7 +185,7 @@ def test_auth_activate_too_many_wrong_code(flask_client): assert r.json["msg"] # get the activation code - act_code = AccountActivation.get(1) + act_code = AccountActivation.first() assert act_code assert len(act_code.code) == 6 assert act_code.tries == 3 @@ -209,7 +209,7 @@ def test_auth_activate_too_many_wrong_code(flask_client): assert r.status_code == 410 # make sure the nb tries decrements - assert AccountActivation.get(1) is None + assert AccountActivation.first() is None def test_auth_reactivate_success(flask_client): @@ -222,7 +222,7 @@ def test_auth_reactivate_success(flask_client): assert r.status_code == 200 # make sure an activation code is created - act_code = AccountActivation.get(1) + act_code = AccountActivation.first() assert act_code assert len(act_code.code) == 6 assert act_code.tries == 3 diff --git a/tests/api/test_notification.py b/tests/api/test_notification.py index d7b81672..362317b3 100644 --- a/tests/api/test_notification.py +++ b/tests/api/test_notification.py @@ -61,5 +61,5 @@ def test_mark_notification_as_read(flask_client): ) assert r.status_code == 200 - notification = Notification.get(1) + notification = Notification.first() assert notification.read