feat: add comprehensive backend API test suite with 193 tests and CI
Add pytest-based test infrastructure with SQLite for fast isolated testing.
Tests cover all 8 app modules (common, accounts, leads, contacts, opportunity,
cases, tasks, invoices) including CRUD, org isolation, kanban, comments, and
auth endpoints. Achieves 54% coverage with a 50% threshold.
Also fixes 10 backend bugs discovered by the test suite:
- Fix serializer read_only_fields for org (teams, documents, board columns/tasks)
- Fix AccountCommentView.put missing partial=True
- Fix UserDetailView broken reverse relation and missing org on address save
- Fix DocumentDetailView.put partial update and null status bug
- Fix TaskDetailView unhandled DoesNotExist → get_object_or_404
- Fix BoardColumn/BoardTask views missing org on save
- Fix LeadListView.post unhandled IntegrityError for duplicate email
- Fix ContactDetailView.get wrong reverse relation name
- Fix OpportunityDetailView null checks before accessing .org
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:22:42 +00:00
|
|
|
[run]
|
|
|
|
|
source = .
|
|
|
|
|
omit =
|
|
|
|
|
*/venv/*
|
|
|
|
|
*/tests/*
|
|
|
|
|
*/test_*
|
|
|
|
|
*/migrations/*
|
|
|
|
|
*/apps.py
|
|
|
|
|
*/admin.py
|
|
|
|
|
manage.py
|
|
|
|
|
setup.py
|
|
|
|
|
crm/wsgi.py
|
|
|
|
|
crm/asgi.py
|
2026-02-17 11:28:52 +00:00
|
|
|
crm/test_settings.py
|
|
|
|
|
crm/server_settings.py
|
|
|
|
|
# Management commands (require DB/infra, tested manually)
|
|
|
|
|
*/management/commands/*
|
|
|
|
|
# Celery async tasks (require broker, tested via integration)
|
|
|
|
|
accounts/tasks.py
|
|
|
|
|
cases/tasks.py
|
|
|
|
|
common/tasks.py
|
|
|
|
|
contacts/tasks.py
|
|
|
|
|
leads/tasks.py
|
|
|
|
|
opportunity/tasks.py
|
|
|
|
|
tasks/celery_tasks.py
|
|
|
|
|
invoices/tasks.py
|
|
|
|
|
# Celery task tests (not API tests, require broker)
|
|
|
|
|
*/tests_celery_tasks.py
|
|
|
|
|
# Seed data / fixtures
|
|
|
|
|
invoices/seed.py
|
|
|
|
|
# Legacy test file (broken imports, kept for reference)
|
|
|
|
|
invoices/tests_legacy.py
|
|
|
|
|
# PDF generation (requires system libs, tested via integration)
|
|
|
|
|
invoices/pdf.py
|
2026-09-26 04:36:25 +00:00
|
|
|
# Workflow and service helpers
|
2026-02-17 11:28:52 +00:00
|
|
|
leads/services.py
|
|
|
|
|
leads/workflow.py
|
|
|
|
|
opportunity/workflow.py
|
|
|
|
|
# Swagger param definitions (no logic)
|
|
|
|
|
*/swagger_params.py
|
|
|
|
|
# Status constants
|
|
|
|
|
common/status.py
|
feat: add comprehensive backend API test suite with 193 tests and CI
Add pytest-based test infrastructure with SQLite for fast isolated testing.
Tests cover all 8 app modules (common, accounts, leads, contacts, opportunity,
cases, tasks, invoices) including CRUD, org isolation, kanban, comments, and
auth endpoints. Achieves 54% coverage with a 50% threshold.
Also fixes 10 backend bugs discovered by the test suite:
- Fix serializer read_only_fields for org (teams, documents, board columns/tasks)
- Fix AccountCommentView.put missing partial=True
- Fix UserDetailView broken reverse relation and missing org on address save
- Fix DocumentDetailView.put partial update and null status bug
- Fix TaskDetailView unhandled DoesNotExist → get_object_or_404
- Fix BoardColumn/BoardTask views missing org on save
- Fix LeadListView.post unhandled IntegrityError for duplicate email
- Fix ContactDetailView.get wrong reverse relation name
- Fix OpportunityDetailView null checks before accessing .org
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:22:42 +00:00
|
|
|
|
added duplicate contacts tabs, fixed time format in marketing campaign list page, added test cases in marketing, added contacts list filter in contacts page (#284)
* updated testcases, update code for account view page, modified code for attachments and comments for assigned user
* updated testcases in events, invoices, tasks modules
* added duplicate contacts tabs, fixed time format in marketing campaign list page, added test cases in marketing, added contacts list filter in contacts page
2019-09-10 05:47:05 +00:00
|
|
|
[report]
|
|
|
|
|
exclude_lines =
|
|
|
|
|
pragma: no cover
|
|
|
|
|
def __unicode__
|
|
|
|
|
def __repr__
|
|
|
|
|
def __str__
|
|
|
|
|
if self\.debug
|
|
|
|
|
raise AssertionError
|
|
|
|
|
raise NotImplementedError
|
|
|
|
|
if 0:
|
|
|
|
|
if __name__ == .__main__.:
|
|
|
|
|
except Exception as e:
|
|
|
|
|
except Exception:
|
|
|
|
|
|
feat: add comprehensive backend API test suite with 193 tests and CI
Add pytest-based test infrastructure with SQLite for fast isolated testing.
Tests cover all 8 app modules (common, accounts, leads, contacts, opportunity,
cases, tasks, invoices) including CRUD, org isolation, kanban, comments, and
auth endpoints. Achieves 54% coverage with a 50% threshold.
Also fixes 10 backend bugs discovered by the test suite:
- Fix serializer read_only_fields for org (teams, documents, board columns/tasks)
- Fix AccountCommentView.put missing partial=True
- Fix UserDetailView broken reverse relation and missing org on address save
- Fix DocumentDetailView.put partial update and null status bug
- Fix TaskDetailView unhandled DoesNotExist → get_object_or_404
- Fix BoardColumn/BoardTask views missing org on save
- Fix LeadListView.post unhandled IntegrityError for duplicate email
- Fix ContactDetailView.get wrong reverse relation name
- Fix OpportunityDetailView null checks before accessing .org
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:22:42 +00:00
|
|
|
show_missing = True
|
|
|
|
|
fail_under = 50
|