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

kobotoolbox / kpi / 15618414823
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: refactor-subsequences-2025
DEFAULT BRANCH: master
Ran 12 Jun 2025 07:14PM UTC
Jobs 2
Files 653
Run time 197min
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

12 Jun 2025 06:37PM UTC coverage: 81.053% (+2.1%) from 78.98%
15618414823

push

github

web-flow
feat(massEmails): preview query results DEV-478 (#5841)


### đŸ“Ŗ Summary
Allow users to download a list of expected recipients of a mass email
based on the query used.


### 📖 Description
Creates ExportJobs for MassEmailConfigs that will have details about the
expected recipients for the emails. Once requested, the user will
receive an email when the job is done and be able to download the list
from Django admin.


### 💭 Notes
Uses the existing django-import-export-celery framework even though it's
more meant for exporting lists of models rather than this kind of
byproduct of a model. However, the framework is already there and allows
multiple formats as well as handling the email portion, and the tweaks
necessary to make it work for a list of users rather than a list of
configs are pretty slight (just doing some work in the `after_export`
hook).
If there are no recipients, the process will just return an empty csv
(only headers). This is not ideal, but there is not an easy way to tell
the user that no recipients were found using just the library. The job
status would be the most obvious place to put this kind of information,
but is part of the ExportJob object which we don't have access to in any
of the export methods. We could run the query first before creating the
export job and use the usual admin error alerts if the query returns
empty, but the query could take a long time and this would defeat the
purpose of doing all the work in the background.


### 👀 Preview steps
Run mailhog or file-backed email for easier testing.

1. â„šī¸ have a superuser account and at least one other
2. In Django admin, update MASS_EMAIL_TEST_EMAILS in Constance with at
least 2 user emails
3. In Django admin, create a MassEmailConfig that uses the 'test_users'
query. Frequency/live doesn't matter here.
4. On the list of MassEmailConfigs, select your new configuration.
5. đŸŸĸ There should be an "Export with celery" action
6. Trigger the export
7. You will be taken to a prefil... (continued)

6279 of 9949 branches covered (63.11%)

12 of 24 new or added lines in 2 files covered. (50.0%)

620 existing lines in 18 files now uncovered.

23960 of 29561 relevant lines covered (81.05%)

1.6 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
12
80.0
-17.67% kobo/apps/mass_emails/models.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
87.32
-1.41% kobo/apps/organizations/admin/organization.py
1
83.33
-5.56% kpi/urls/__init__.py
1
93.62
-2.13% kpi/utils/django_orm_helper.py
2
93.53
-1.0% kobo/apps/mass_emails/tasks.py
3
63.64
-27.27% kobo/apps/accounts/utils.py
3
82.32
-1.83% kobo/apps/organizations/models.py
3
86.67
-10.0% kobo/apps/organizations/utils.py
3
90.52
-2.59% kpi/views/environment.py
4
83.33
-8.33% kobo/apps/accounts/mfa/models.py
8
0.0
-100.0% kobo/apps/stripe/urls.py
19
0.0
-65.52% kobo/apps/stripe/admin.py
23
59.02
-37.7% kobo/apps/trackers/utils.py
24
75.0
-24.0% kpi/utils/usage_calculator.py
25
47.89
-35.21% kobo/apps/mass_emails/user_queries.py
64
0.0
-98.46% kobo/apps/stripe/serializers.py
116
0.0
-91.34% kobo/apps/stripe/models.py
154
0.0
-95.65% kobo/apps/stripe/views.py
166
22.77
-74.11% kobo/apps/stripe/utils.py
Jobs
ID Job ID Ran Files Coverage
1 15618414823.1 12 Jun 2025 07:14PM UTC 653
78.96
2 15618414823.2 12 Jun 2025 07:16PM UTC 653
81.03
Source Files on build 15618414823
  • Tree
  • List 653
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 73adc79b on github
  • Prev Build on main (#15616370692)
  • Next Build on main (#15687580355)
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