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):
def test2ChangePermission(self):
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()
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()
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):
request.vars["type"] = "patient"
......
......@@ -148,16 +148,17 @@ db.auth_permission.insert(group_id = fake_group_id,
)
# 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_patient = db.patient.insert(first_name="foo",
last_name="bar",
info="permission",
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,
table_name = "patient",
record_id = permission_patient
table_name = "sample_set",
record_id = permission_sample_set
)
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,
name = PermissionEnum.access.value,
table_name = 'run',
record_id = fake_run_id)
table_name = 'sample_set',
record_id = fake_sample_set_id)
# and a fake file for this patient
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