Exemple #1
0
def check_total_employee(auth=None, all=None):
    auth_count = auth or User.get_auth_user_count()
    all_count = all or User.get_all_users_count()
    if auth_count > all_count:
        return jsonify({
            "auth_count": auth_count,
            "all_count": all_count,
            "msg": "Error! Auth emp count is more than employees"
        })
    elif auth_count < all_count:
        percent = int((auth_count / all_count) * 100)
        if percent < 95:
            return jsonify({
                "auth_count": auth_count,
                "all_count": all_count,
                "msg": "Percentage of joining is too less"
            })
        else:
            return jsonify({
                "auth_count": auth_count,
                "all_count": all_count,
                "msg": "Percentage of joining is OK"
            })
    else:
        return jsonify({
            "auth_count": auth_count,
            "all_count": all_count,
            "msg": "All good"
        })
Exemple #2
0
 def test_get_auth_user_count(self, mock_user):
     mock_user.query.filter_by(authenticated=1).count.return_value = 9981
     count = User.get_auth_user_count()
     #print (count)
     self.assertEqual(count, 9989)
Exemple #3
0
def get_auth_users():
    auth_users = User.get_auth_user_count()
    return jsonify({"count": auth_users})