diff --git a/tests/all/integration/api/helpers/test_auth.py b/tests/all/integration/api/helpers/test_auth.py new file mode 100644 index 0000000000..9c1a1f5022 --- /dev/null +++ b/tests/all/integration/api/helpers/test_auth.py @@ -0,0 +1,27 @@ +from app import current_app as app +from tests.all.integration.auth_helper import create_user +from tests.all.integration.utils import OpenEventTestCase +from app.api.helpers import auth +from tests.all.integration.setup_database import Setup +from app.models import db +from app.models.user import User + +import unittest + + +class TestAuthentication(OpenEventTestCase): + def setUp(self): + self.app = Setup.create_app() + + def test_load_user(self): + """Method to test the registered user details""" + + with app.test_request_context(): + auth_manager = auth.AuthManager() + auth_manager.init_login(app) + user = create_user(email='authtest@gmail.com', password='password') + self.assertEqual(user, db.session.query(User).get(user.id)) + + +if __name__ == '__main__': + unittest.main()