Files
django-nepkit/pyproject.toml
T
sankalp d7c13a0cf5 test: add comprehensive pytest test suite with 67% coverage
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
2026-01-30 18:41:38 +05:45

78 lines
1.7 KiB
TOML

[build-system]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "django-nepkit"
version = "0.1.0"
description = "Django Nepali date, time, phone, and address fields with helpers."
readme = "README.md"
authors = [
{ name = "Sankalp Tharu", email = "sankalptharu50028@gmail.com" }
]
license = { text = "MIT" }
requires-python = ">=3.11"
dependencies = [
"django>=4.2",
"django-filter>=25.2",
"djangorestframework>=3.16.1",
"nepali>=1.1.3",
]
keywords = [
"django",
"django-fields",
"django-forms",
"nepal",
"nepali",
"nepali-date",
"bikram-sambat",
"nepali-calendar",
"timezone",
"asia-kathmandu",
"phone-number",
"address",
"province",
"district",
"municipality"
]
classifiers = [
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 6.0",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Operating System :: OS Independent",
"Natural Language :: English"
]
[project.optional-dependencies]
drf = [
"djangorestframework>=3.14",
"django-filter>=23.1",
]
[project.urls]
Homepage = "https://github.com/S4NKALP/django-nepkit"
[dependency-groups]
dev = [
"pre-commit>=4.5.1",
"pytest>=9.0.2",
"pytest-cov>=7.0.0",
"ruff>=0.14.14",
]
[tool.setuptools.packages.find]
include = ["django_nepkit", "example", "example.*"]