def activateAccount(token): try: user = User.getUserByEmail(UserHandler.verifyUserToken(token)) if user is None: pass User.activateUser(user) except Exception as err: return jsonify( message="Server error!", error=err.__str__()), HttpStatus.INTERNAL_SERVER_ERROR return jsonify(status='Success!'), HttpStatus.OK
def test_activate_user(self): data = {'email': 'test', 'password': '******', 'username': '******'} user = User(**data).create() user.activateUser() assert user.active == True