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
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])
def test_get_meta_data_files(self): for item in get_metadata_files(self.draft): nt.assert_in(type(item), [OsfStorageFile, OsfStorageFileNode])
def checkin_files(draft): if draft.approval_id: for item in get_metadata_files(draft): item.checkout = None item.save()