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]
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]
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]
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]
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]
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]
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]
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]
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]
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]