Attention une mise à jour du serveur va être effectuée le vendredi 16 avril entre 12h et 12h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit aef0e801 authored by Ryan Herbert's avatar Ryan Herbert Committed by Mikaël Salson

update usages of SampleSetList to use helpers

parent 20d114a8
......@@ -280,13 +280,14 @@ def stats():
search, tags = parse_search(request.vars["filter"])
group_ids = get_involved_groups()
list = SampleSetList(type, tags=tags)
factory = ModelFactory()
helper = factory.get_instance(type=type)
list = SampleSetList(helper, tags=tags)
list.load_sample_information()
list.load_anon_permissions()
result = list.get_values()
factory = ModelFactory()
helper = factory.get_instance(type=type)
fields = helper.get_reduced_fields()
##sort result
......
......@@ -16,11 +16,15 @@ class SamplesetlistModel(unittest.TestCase):
auth.login_bare("test@vidjil.org", "123456")
def testInit(self):
slist = SampleSetList('patient')
factory = ModelFactory()
helper = factory.get_instance(type='patient')
slist = SampleSetList(helper)
self.assertTrue(len(slist.element_ids) > 0, "The sample set list was not expected to be empty")
def testCreatorNames(self):
slist = SampleSetList('patient')
factory = ModelFactory()
helper = factory.get_instance(type='patient')
slist = SampleSetList(helper)
slist.load_creator_names()
values = slist.get_values()
first = values[0]
......@@ -28,7 +32,9 @@ class SamplesetlistModel(unittest.TestCase):
self.assertFalse(name == "", "load_creator_names failed to retrieve a username")
def testPermittedGroups(self):
slist = SampleSetList('patient')
factory = ModelFactory()
helper = factory.get_instance(type='patient')
slist = SampleSetList(helper)
slist.load_permitted_groups()
value = slist.get_values()[0]
groups = value.groups
......@@ -38,7 +44,9 @@ class SamplesetlistModel(unittest.TestCase):
self.assertFalse(group_list == [], "load_permitted_groups found groups although the group_list is empty")
def testAnonPermissions(self):
slist = SampleSetList('patient')
factory = ModelFactory()
helper = factory.get_instance(type='patient')
slist = SampleSetList(helper)
slist.load_anon_permissions()
value = slist.get_values()[0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment