Commit 517de391 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

tests/unit/models/ Add tests

Names are anonymized hence we only test the three first letter of the name
parent 2b9f6305
import unittest
class SamplesetsModel(unittest.TestCase):
def __init__(self, p):
global auth
unittest.TestCase.__init__(self, p)
def setUp(self):
# Load the to-be-tested file
execfile("applications/vidjil/models/", globals())
global auth
auth = VidjilAuth(globals(), db)
auth.login_bare("", "1234")
# We have the following sample sets
# fake_sample_set_id linked to fake_patient_id
# whose first and last name are plop
# permission_sample_set linked to permission_patient
# whose name is foo bar
def testGetNames(self):
samples = SampleSets([fake_sample_set_id, permission_sample_set])
names = samples.get_names()
self.assertEquals(names[fake_sample_set_id], "plo")
self.assertEquals(names[permission_sample_set], "bar")
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