예제 #1
0
 def test_study_delete_req_error(self):
     obs = study_delete_req(1, '*****@*****.**')
     exp = {'status': 'error',
            'message': 'Unable to delete study: Study "Identification of '
                       'the Microbiomes for Cannabis Soils" cannot be '
                       'erased because it has a sample template'}
     self.assertEqual(obs, exp)
예제 #2
0
 def test_study_delete_req_no_access(self):
     obs = study_delete_req(1, '*****@*****.**')
     exp = {
         'status': 'error',
         'message': 'User does not have access to study'
     }
     self.assertEqual(obs, exp)
예제 #3
0
 def test_study_delete_req_error(self):
     obs = study_delete_req(1, '*****@*****.**')
     exp = {
         'status':
         'error',
         'message':
         'Unable to delete study: Study "Identification of '
         'the Microbiomes for Cannabis Soils" cannot be '
         'erased because it has a sample template'
     }
     self.assertEqual(obs, exp)
예제 #4
0
    def test_study_delete_req(self):
        info = {
            "timeseries_type_id": 1,
            "metadata_complete": True,
            "mixs_compliant": True,
            "number_samples_collected": 25,
            "number_samples_promised": 28,
            "study_alias": "FCM",
            "study_description": "DESC",
            "study_abstract": "ABS",
            "emp_person_id": qdb.study.StudyPerson(2),
            "principal_investigator_id": qdb.study.StudyPerson(3),
            "lab_person_id": qdb.study.StudyPerson(1)
        }

        new_study = qdb.study.Study.create(qdb.user.User('*****@*****.**'),
                                           "Some New Study", [1], info)

        study_delete_req(new_study.id, '*****@*****.**')

        with self.assertRaises(qdb.exceptions.QiitaDBUnknownIDError):
            qdb.study.Study(new_study.id)
예제 #5
0
    def test_study_delete_req(self):
        info = {
            "timeseries_type_id": 1,
            "metadata_complete": True,
            "mixs_compliant": True,
            "number_samples_collected": 25,
            "number_samples_promised": 28,
            "study_alias": "FCM",
            "study_description": "DESC",
            "study_abstract": "ABS",
            "emp_person_id": qdb.study.StudyPerson(2),
            "principal_investigator_id": qdb.study.StudyPerson(3),
            "lab_person_id": qdb.study.StudyPerson(1)
        }

        new_study = qdb.study.Study.create(
            qdb.user.User('*****@*****.**'), "Some New Study", [1],
            info)

        study_delete_req(new_study.id, '*****@*****.**')

        with self.assertRaises(qdb.exceptions.QiitaDBUnknownIDError):
            qdb.study.Study(new_study.id)
예제 #6
0
 def test_study_delete_req_no_exists(self):
     obs = study_delete_req(4, '*****@*****.**')
     exp = {'status': 'error', 'message': 'Study does not exist'}
     self.assertEqual(obs, exp)
예제 #7
0
 def test_study_delete_req_no_exists(self):
     obs = study_delete_req(4, '*****@*****.**')
     exp = {'status': 'error',
            'message': 'Study does not exist'}
     self.assertEqual(obs, exp)
예제 #8
0
 def test_study_delete_req_no_access(self):
     obs = study_delete_req(1, '*****@*****.**')
     exp = {'status': 'error',
            'message': 'User does not have access to study'}
     self.assertEqual(obs, exp)