Example #1
0
 def test_wrong_provider_odd(self):
     data = self.draft.registration_metadata
     data['q26']['extra'][0]['data']['provider'] = 'box'
     self.draft.update_metadata(data)
     with nt.assert_raises(Http404):
         for item in get_metadata_files(self.draft):
             pass
Example #2
0
 def test_wrong_provider_odd(self):
     data = self.draft.registration_metadata
     data['q26']['extra'][0]['data']['provider'] = 'box'
     self.draft.update_metadata(data)
     with nt.assert_raises(Http404):
         for item in get_metadata_files(self.draft):
             pass
Example #3
0
 def test_file_id_missing_odd(self):
     data = self.draft.registration_metadata
     data['q26']['extra'][0].pop('fileId')
     self.draft.update_metadata(data)
     for item in get_metadata_files(self.draft):
         nt.assert_in(type(item), [OsfStorageFile, OsfStorageFileNode])
Example #4
0
 def test_get_meta_data_files(self):
     for item in get_metadata_files(self.draft):
         nt.assert_in(type(item), [OsfStorageFile, OsfStorageFileNode])
Example #5
0
 def test_file_id_missing_odd(self):
     data = self.draft.registration_metadata
     data['q26']['extra'][0].pop('fileId')
     self.draft.update_metadata(data)
     for item in get_metadata_files(self.draft):
         nt.assert_in(type(item), [OsfStorageFile, OsfStorageFileNode])
Example #6
0
 def test_get_meta_data_files(self):
     for item in get_metadata_files(self.draft):
         nt.assert_in(type(item), [OsfStorageFile, OsfStorageFileNode])
Example #7
0
def checkin_files(draft):
    if draft.approval_id:
        for item in get_metadata_files(draft):
            item.checkout = None
            item.save()
Example #8
0
def checkin_files(draft):
    if draft.approval_id:
        for item in get_metadata_files(draft):
            item.checkout = None
            item.save()