def test_remove(self): release_form = ReleaseForm({'pk': self.delivery.release.pk, 'remove': True}) release_form.is_valid() release_processor = ReleaseProcessor(delivery=self.delivery, release_form=release_form, artist=self.artist, label=self.label, disc=self.disc, vendor=self.vendor) release_processor.remove() self.assertFalse(os.listdir(self.album_directory))
def test_annuler(self): release_form = ReleaseForm(data={'pk': self.delivery.release.pk, 'annuler': True}) release_form.is_valid() release_processor = ReleaseProcessor(delivery=self.delivery, release_form=release_form, artist=self.artist, label=self.label, disc=self.disc, vendor=self.vendor) release_processor.remove() self.assertRaises(Album.DoesNotExist, Album.objects.get, albumvendor__external_album_id=self.delivery.release.pk) self.assertFalse(os.path.exists(self.delivery.path)) self.assertTrue(release_form.report.success)