From: Guillaume Pellerin Date: Fri, 6 Mar 2015 12:12:24 +0000 (+0100) Subject: cleanup boilerplate results X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=31355a1d1ae499a0ed4ac66cc0cbc6977f1170df;p=timeside.git cleanup boilerplate results --- diff --git a/timeside/server/management/commands/timeside-tests-boilerplate.py b/timeside/server/management/commands/timeside-tests-boilerplate.py index 3cb3a7d..855f7f6 100644 --- a/timeside/server/management/commands/timeside-tests-boilerplate.py +++ b/timeside/server/management/commands/timeside-tests-boilerplate.py @@ -12,6 +12,7 @@ from timeside.core.tools.test_samples import generateSamples class Command(BaseCommand): help = "Setup and run a boilerplate for testing" + cleanup = True def processor_cleanup(self): for processor in Processor.objects.all(): @@ -22,10 +23,6 @@ class Command(BaseCommand): result.delete() def handle(self, *args, **options): - # NOT for production - self.processor_cleanup() - # self.result_cleanup() - presets = [] blacklist =['decoder', 'live', 'gain'] processors = timeside.core.processor.processors(timeside.core.api.IProcessor) @@ -51,6 +48,9 @@ class Command(BaseCommand): item, c = Item.objects.get_or_create(title=title, file=path) if not item in selection.items.all(): selection.items.add(item) + if self.cleanup: + for result in item.results.all(): + result.delete() experience, c = Experience.objects.get_or_create(title='All') for preset in presets: