• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

akvo / iwsims-demo / #72

28 Apr 2025 03:28AM UTC coverage: 86.134% (+1.1%) from 85.024%
#72

push

coveralls-python

web-flow
Merge pull request #20 from akvo/feature/19-eng-1231-dynamic-level-approval

Feature/19 eng 1231 dynamic level approval

2646 of 3188 branches covered (83.0%)

Branch coverage included in aggregate %.

5995 of 6844 relevant lines covered (87.59%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.59
backend/api/v1/v1_mobile/management/commands/generate_sqlite.py
1
from django.core.management import BaseCommand
1✔
2
from utils.custom_generator import generate_sqlite
1✔
3
from api.v1.v1_profile.models import Administration, Entity, EntityData
1✔
4
from api.v1.v1_users.models import Organisation
1✔
5

6

7
class Command(BaseCommand):
1✔
8
    # Add test arguments
9
    def add_arguments(self, parser):
1✔
10
        parser.add_argument(
1✔
11
            "-t", "--test", nargs="?", const=False, default=False, type=bool
12
        )
13

14
    def handle(self, *args, **options):
1✔
15
        test = options.get("test", False)
1✔
16
        file = generate_sqlite(Administration, test=test)
1✔
17
        if not test:
1!
18
            self.log_generated(file, Administration)
×
19
        file = generate_sqlite(Organisation, test=test)
1✔
20
        if not test:
1!
21
            self.log_generated(file, Organisation)
×
22
        file = generate_sqlite(Entity, test=test)
1✔
23
        if not test:
1!
24
            self.log_generated(file, Entity)
×
25
        file = generate_sqlite(EntityData, test=test)
1✔
26
        if not test:
1!
27
            self.log_generated(file, EntityData)
×
28

29
    def log_generated(self, file, model):
1✔
30
        message = (
×
31
            f"{file} Generated Successfully"
32
            if file
33
            else (
34
                f"Failed to generate {model._meta.db_table}, "
35
                "possibly empty data"
36
            )
37
        )
38
        print(message)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc