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

SampleSetList update unit tests

parent fc95ea04
......@@ -19,37 +19,32 @@ class SamplesetlistModel(unittest.TestCase):
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")
self.assertTrue(len(slist) > 0, "The sample set list was not expected to be empty")
def testCreatorNames(self):
factory = ModelFactory()
helper = factory.get_instance(type='patient')
slist = SampleSetList(helper)
slist.load_creator_names()
values = slist.get_values()
values = slist.result
first = values[0]
name = first.creator
name = helper.get_creator(first)
self.assertFalse(name == "", "load_creator_names failed to retrieve a username")
def testPermittedGroups(self):
factory = ModelFactory()
helper = factory.get_instance(type='patient')
slist = SampleSetList(helper)
slist.load_permitted_groups()
value = slist.get_values()[0]
groups = value.groups
group_list = value.group_list
value = slist.result[0]
groups = helper.get_groups(value)
self.assertFalse(groups == "", "load_permitted_groups didn't load ay groups")
self.assertFalse(group_list == [], "load_permitted_groups found groups although the group_list is empty")
def testAnonPermissions(self):
factory = ModelFactory()
helper = factory.get_instance(type='patient')
slist = SampleSetList(helper)
slist.load_anon_permissions()
value = slist.get_values()[0]
value = slist.result[0]
self.assertFalse(value.anon_allowed, "Anon was allowed, when it was not expected to be")
self.assertFalse(value.has_permission, "Anon was allowed, when it was not expected to be")
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