From 57722c6ef55c01ac8cac65b2a77b0cb64509e434 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Sat, 2 Aug 2014 08:36:45 -0400 Subject: [PATCH] Fix get_test_run_by_run_id() db api method The get_test_run_by_run_id() method was broken, it was using the incorrect db model name. (a copy and paste error) so the method would not work. This corrects the issue so you can get all the test runs for a give run_id field. Change-Id: I289b04f8a1a26a34be2e22507c95a80c9347b1ad --- subunit2sql/db/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subunit2sql/db/api.py b/subunit2sql/db/api.py index 49b816c..040d350 100644 --- a/subunit2sql/db/api.py +++ b/subunit2sql/db/api.py @@ -205,7 +205,8 @@ def get_test_runs_by_test_id(test_id, session=None): def get_test_runs_by_run_id(run_id, session=None): session = session or get_session() - test_runs = db_utils.model_query(models.Run, session=session).filter_by( + test_runs = db_utils.model_query(models.TestRun, + session=session).filter_by( run_id=run_id).all() return test_runs