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

akvo / akvo-mis / #765
89%
main: 89%

Build:
Build:
LAST BUILD BRANCH: feature/273-two-phase-registration
DEFAULT BRANCH: main
Ran 29 Jul 2026 03:57AM UTC
Jobs 1
Files 111
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Jul 2026 03:48AM UTC coverage: 88.593% (+0.07%) from 88.523%
#765

Pull #280

coveralls-python

web-flow
[#269] Record tenant ownership on the definition-root tables (#279)

* [#269] Add tenant ownership to the six definition-root tables

Levels, Administration, Forms, Organisation, Entity and
AdministrationAttribute are the only tables with no FK path to a
tenant; everything else derives through existing relations. Each gains
a nullable PROTECT tenant FK, so existing rows and the test seeders
stay valid.

Uniqueness moves per-tenant where it was global or implicit: level
numbers (previously convention only), one root administration per
tenant, and organisation names. NULL tenants are exempt because
Postgres treats NULLs as distinct, which keeps seeded test data
unconstrained.

* [#269] Backfill existing rows to a default tenant

A data migration creates a tenant with subdomain "default" and stamps
it onto every pre-existing row of the seven tenant-owned tables.
Existing single-tenant deployments therefore migrate with no behavior
change: their data simply becomes the default tenant's.

The migration is idempotent (filtered update), reversible (FKs nulled,
tenant removed), and uses _base_manager so soft-deleted rows are
stamped as well.

* [#269] Create a per-tenant hierarchy on every registration

With Levels and Administration carrying tenant ownership, the
get-or-create sharing of the first tenant's hierarchy is retired:
each registration creates its own unnamed level 0 and its own root
unit inside the same transaction. Simpler code than the conditional
version, and hierarchies are disjoint from birth.

The registration tests now count tenants through a helper that
excludes the "default" tenant. The backfill migration runs when Django
builds the test database, so that row is present in every test — the
bare Tenant.objects.count() assertions written in the previous
iteration would otherwise be off by one.

* [#269] Resolve each tenant superadmin to their own root administration

Superuser profile scoping substituted the first root it found, which
was c... (continued)
Pull Request #280: Epic/multi tenant saas

5707 of 6609 branches covered (86.35%)

Branch coverage included in aggregate %.

10789 of 12011 relevant lines covered (89.83%)

0.9 hits per line

Coverage Regressions

Lines Coverage ∆ File
47
85.55
0.41% api/v1/v1_users/serializers.py
39
84.51
1.02% api/v1/v1_users/views.py
8
89.02
0.96% api/v1/v1_users/models.py
6
96.05
0.05% api/v1/v1_forms/models.py
4
92.42
0.42% api/v1/v1_profile/management/commands/administration_seeder.py
2
99.04
0.53% api/v1/v1_profile/models.py
1
95.74
-0.09% api/v1/v1_data/management/commands/generate_config.py
1
95.02
1.49% utils/custom_generator.py
Jobs
ID Job ID Ran Files Coverage
1 #765.1 29 Jul 2026 03:57AM UTC 111
88.59
Source Files on build #765
  • Tree
  • List 111
  • Changed 9
  • Source Changed 0
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Pull Request #280
  • PR Base - main (#)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc