From 4817d78b22b899b9beb3fd3a99a10d6cbcee22d6 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 18 Feb 2021 22:05:43 +0000 Subject: Fixed test_gen_menu to reflect updated query --- wqflask/tests/unit/wqflask/api/test_gen_menu.py | 7 ++++--- wqflask/wqflask/api/gen_menu.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wqflask/tests/unit/wqflask/api/test_gen_menu.py b/wqflask/tests/unit/wqflask/api/test_gen_menu.py index cc666f0c..57eb1650 100644 --- a/wqflask/tests/unit/wqflask/api/test_gen_menu.py +++ b/wqflask/tests/unit/wqflask/api/test_gen_menu.py @@ -244,10 +244,11 @@ class TestGenMenu(unittest.TestCase): "ProbeFreeze, InbredSet, Tissue, Species WHERE " + "Species.Name = 'Mouse' AND Species.Id = " + "InbredSet.SpeciesId AND InbredSet.Name = 'HLC' AND " + - "ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and " + + "ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id AND " + "Tissue.Name = 'mRNA' AND ProbeFreeze.TissueId = " + - "Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id " + - "ORDER BY ProbeSetFreeze.OrderList DESC") + "Tissue.Id AND ProbeFreeze.InbredSetId = InbredSet.Id AND " + + "ProbeSetFreeze.public > 0 " + + "ORDER BY -ProbeSetFreeze.OrderList DESC, ProbeSetFreeze.CreateTime DESC") @mock.patch('wqflask.api.gen_menu.build_datasets') @mock.patch('wqflask.api.gen_menu.g') diff --git a/wqflask/wqflask/api/gen_menu.py b/wqflask/wqflask/api/gen_menu.py index 4ce19fdb..18afc5ad 100644 --- a/wqflask/wqflask/api/gen_menu.py +++ b/wqflask/wqflask/api/gen_menu.py @@ -207,7 +207,7 @@ def build_datasets(species, group, type_name): "InbredSet.SpeciesId AND InbredSet.Name = '{1}' " "AND ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id " "AND Tissue.Name = '{2}' AND ProbeFreeze.TissueId = " - "Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id " + "Tissue.Id AND ProbeFreeze.InbredSetId = InbredSet.Id " "AND ProbeSetFreeze.public > 0 " "ORDER BY -ProbeSetFreeze.OrderList DESC, ProbeSetFreeze.CreateTime DESC").format(species, group, type_name)).fetchall() -- cgit v1.2.3