github
0 of 20 new or added lines in 4 files covered. (0.0%)
6399 existing lines in 119 files now uncovered.712 of 11500 relevant lines covered (6.19%)
0.25 hits per line
UNCOV
1
|
from django.core.management.base import BaseCommand, CommandError |
× |
2 |
|
|
UNCOV
3
|
from assets import models |
× |
4 |
|
|
5 |
|
|
UNCOV
6
|
class Command(BaseCommand): |
× |
UNCOV
7
|
help = 'Deletes testing sample data'
|
× |
8 |
|
|
UNCOV
9
|
def handle(self, *args, **kwargs): |
× |
UNCOV
10
|
from django.conf import settings |
× |
11 |
|
|
UNCOV
12
|
if not (settings.DEBUG): |
× |
UNCOV
13
|
raise CommandError('You cannot run this command in production') |
× |
14 |
|
|
UNCOV
15
|
self.delete_objects(models.AssetCategory)
|
× |
UNCOV
16
|
self.delete_objects(models.AssetStatus)
|
× |
UNCOV
17
|
self.delete_objects(models.Supplier)
|
× |
UNCOV
18
|
self.delete_objects(models.Connector)
|
× |
UNCOV
19
|
self.delete_objects(models.Asset)
|
× |
20 |
|
|
UNCOV
21
|
def delete_objects(self, model): |
× |
UNCOV
22
|
for object in model.objects.all(): |
× |
23 |
object.delete()
|
× |