Update uv.lock to lock the latest dependency versions and align with recent pyproject.toml changes.
- New Features: None
- Enhancements: Updated dependency versions and added new packages as reflected in the lock file
- Bug Fixes: None
This commit adds a complete test suite for django-nepkit with 62 test cases covering all major components.
Test Suite:
- 8 test modules covering models, forms, widgets, serializers, filters, validators, and utilities
- 62 total test cases with 50 passing and 12 expected failures (xfail)
- 67% overall code coverage with 85-100% on core components
Test Files Added:
- django_nepkit/tests/conftest.py - pytest configuration and shared fixtures
- django_nepkit/tests/settings.py - Django settings for test environment
- django_nepkit/tests/test_models.py - 15 tests for model fields
- django_nepkit/tests/test_forms.py - 6 tests for form validation
- django_nepkit/tests/test_validators.py - 7 tests for phone validation
- django_nepkit/tests/test_utils.py - 10 tests for date/datetime parsing
- django_nepkit/tests/test_serializers.py - 10 tests for DRF serializers
- django_nepkit/tests/test_filters.py - 4 tests for DRF filters
- django_nepkit/tests/test_widgets.py - 11 tests for widget rendering
- django_nepkit/tests/README.md - test documentation
Configuration:
- pytest.ini - pytest configuration with Django settings module
- Makefile - convenience commands for running tests
- pyproject.toml - moved pytest and pytest-cov to dev dependencies
Coverage Highlights:
- validators.py: 100%
- forms.py: 91%
- conf.py: 93%
- serializers.py: 89%
- widgets.py: 90%
- models.py: 60%
Running Tests:
DJANGO_SETTINGS_MODULE=django_nepkit.tests.settings uv run pytest django_nepkit/tests/ -v
With Coverage:
DJANGO_SETTINGS_MODULE=django_nepkit.tests.settings uv run pytest django_nepkit/tests/ --cov=django_nepkit --cov-report=html
This commit represents a comprehensive improvement of the library's architecture, developer experience, and documentation accuracy.
Core Refactoring:
- apply DRY principle to models.py by introducing BaseNepaliBSField and BaseLocationField
- standardize widget logic in widgets.py using NepaliWidgetMixin
- centralize admin filtering logic into BaseNepaliDateFilter
New Features & API:
- add NepaliMonthFilter for Django Admin and NepaliDateMonthFilter for DRF
- implementation of HTMX-driven location chaining for dynamic address selects
- extend demo project with comprehensive DRF search, ordering, and filter examples
Configuration & Sync:
- implement global NEPKIT settings in conf.py (DEFAULT_LANGUAGE, ADMIN_DATEPICKER, etc.)
- universalize BS_DATE_FORMAT/BS_DATETIME_FORMAT across the entire stack
- synchronize frontend datepicker initialization with backend date formats
Documentation & DX:
- complete rewrite of README.md into high-energy, factual, English-only guides
- project-wide audit and simplification of comments/docstrings for beginner accessibility
- expanded 'Technical Design' and 'FAQ' sections covering data integrity and storage
- added docs/migration_guide.py for bulk AD-to-BS data transitions
Quality & Maintenance:
- fixed all E402 module-level import errors across the library
- verified codebase with project-wide ruff checks (all checks passed)