Exemple #1
0
def test_organization_id():
    conn = db()
    cursor = conn.cursor()
    sql = 'SELECT id FROM organization WHERE name = "test-organization"'
    cursor.execute(sql)
    result = cursor.fetchone()
    conn.close()

    return result[0]
Exemple #2
0
def test_criteria_id():
    conn = db()
    cursor = conn.cursor()
    sql = 'SELECT id FROM criteria WHERE name = "test-criteria"'
    cursor.execute(sql)
    result = cursor.fetchone()
    conn.close()

    return result[0]
Exemple #3
0
def test_role_id():
    conn = db()
    cursor = conn.cursor()
    sql = 'SELECT id FROM role WHERE name = "test-role"'
    cursor.execute(sql)
    result = cursor.fetchone()
    conn.close()

    return result[0]
Exemple #4
0
def test_event_id():
    conn = db()
    cursor = conn.cursor()
    sql = 'SELECT id FROM event WHERE name = "test-event"'
    cursor.execute(sql)
    result = cursor.fetchone()
    conn.close()

    return result[0]
Exemple #5
0
def test_participant_id():
    conn = db()
    cursor = conn.cursor()
    sql = 'SELECT id FROM participant WHERE email = "*****@*****.**"'
    cursor.execute(sql)
    result = cursor.fetchone()
    conn.close()

    return result[0]
Exemple #6
0
def test_participant_team_id():
    conn = db()
    cursor = conn.cursor()
    sql = 'SELECT id FROM participant_team WHERE name = "test-participant-team"'
    cursor.execute(sql)
    result = cursor.fetchone()
    conn.close()

    return result[0]
Exemple #7
0
def test_user_id():
    conn = db()
    cursor = conn.cursor()
    sql = 'SELECT id FROM user WHERE username = "******"'
    cursor.execute(sql)
    result = cursor.fetchone()
    conn.close()

    return result[0]
Exemple #8
0
def test_event_score_id():
    conn = db()
    cursor = conn.cursor()
    sql = """
        SELECT event_score.id FROM event_score
        INNER JOIN criteria ON criteria.id = event_score.criteria_id
        WHERE criteria.name = "test-criteria"
    """
    cursor.execute(sql)
    result = cursor.fetchone()
    conn.close()

    return result[0]
Exemple #9
0
def test_event_participant_id():
    conn = db()
    cursor = conn.cursor()
    sql = """
        SELECT event_participant.id FROM event_participant
        INNER JOIN event ON event.id = event_participant.event_id
        WHERE event.name = "test-event"
    """
    cursor.execute(sql)
    result = cursor.fetchone()
    conn.close()

    return result[0]
Exemple #10
0
def test_judge_id():
    conn = db()
    cursor = conn.cursor()
    sql = 'SELECT id FROM user WHERE username = "******"'
    cursor.execute(sql)
    result = cursor.fetchone()

    sql2 = 'SELECT id FROM judge WHERE user_id = ' + str(result[0])
    cursor.execute(sql2)
    result2 = cursor.fetchone()
    conn.close()

    return result2[0]