Attention une mise à jour du service Gitlab va être effectuée le mardi 18 janvier (et non lundi 17 comme annoncé précédemment) entre 18h00 et 18h30. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 6b87a0dd authored by marc duez's avatar marc duez
Browse files

testRunner.py : update db init

added another group for permission tests (default group had admin privilege)
parent 7840ac4d
Pipeline #236238 passed with stages
in 10 minutes and 52 seconds
...@@ -62,13 +62,13 @@ class Sample_setController(unittest.TestCase): ...@@ -62,13 +62,13 @@ class Sample_setController(unittest.TestCase):
def test2ChangePermission(self): def test2ChangePermission(self):
request.vars["sample_set_id"] = permission_sample_set request.vars["sample_set_id"] = permission_sample_set
request.vars["group_id"] = fake_group_id request.vars["group_id"] = permission_group_id
resp = change_permission() resp = change_permission()
self.assertFalse(auth.get_group_access('sample_set', permission_sample_set, fake_group_id), "fail to remove permission") self.assertFalse(auth.get_group_access('sample_set', permission_sample_set, permission_group_id), "fail to remove permission")
resp = change_permission() resp = change_permission()
self.assertTrue(auth.get_group_access('sample_set', permission_sample_set, fake_group_id), "fail to add permission") self.assertTrue(auth.get_group_access('sample_set', permission_sample_set, permission_group_id), "fail to add permission")
def testForm(self): def testForm(self):
request.vars["type"] = "patient" request.vars["type"] = "patient"
......
...@@ -148,16 +148,17 @@ db.auth_permission.insert(group_id = fake_group_id, ...@@ -148,16 +148,17 @@ db.auth_permission.insert(group_id = fake_group_id,
) )
# for permission testing # for permission testing
permission_group_id = db.auth_group.insert(role="test_group_perm", description="test group perm")
permission_sample_set = db.sample_set.insert(sample_type="patient") permission_sample_set = db.sample_set.insert(sample_type="patient")
permission_patient = db.patient.insert(first_name="foo", permission_patient = db.patient.insert(first_name="foo",
last_name="bar", last_name="bar",
info="permission", info="permission",
sample_set_id=permission_sample_set) sample_set_id=permission_sample_set)
db.auth_permission.insert(group_id = fake_group_id, db.auth_permission.insert(group_id = permission_group_id,
name = PermissionEnum.access.value, name = PermissionEnum.access.value,
table_name = "patient", table_name = "sample_set",
record_id = permission_patient record_id = permission_sample_set
) )
fake_run_id = db.run.insert(name="foobar", fake_run_id = db.run.insert(name="foobar",
...@@ -169,8 +170,8 @@ fake_run_id = db.run.insert(name="foobar", ...@@ -169,8 +170,8 @@ fake_run_id = db.run.insert(name="foobar",
db.auth_permission.insert(group_id = fake_group_id, db.auth_permission.insert(group_id = fake_group_id,
name = PermissionEnum.access.value, name = PermissionEnum.access.value,
table_name = 'run', table_name = 'sample_set',
record_id = fake_run_id) record_id = fake_sample_set_id)
# and a fake file for this patient # and a fake file for this patient
fake_file_id = db.sequence_file.insert(sampling_date="1903-02-02", fake_file_id = db.sequence_file.insert(sampling_date="1903-02-02",
......
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