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

NextGenContributions / django2pydantic / 16319350695

16 Jul 2025 12:23PM UTC coverage: 86.806% (+1.5%) from 85.26%
16319350695

push

github

web-flow
feat: make fields optional even if required by the django field (#119)

- Add examples for making Django fields optional and overriding field properties
- Created a new Jupyter notebook `making-fields-optional-with-InferExcept.ipynb` demonstrating how to make a required Django field optional using `InferExcept`.
- Created a new Jupyter notebook `overriding-django-field-properties-with-InferExcept.ipynb` showcasing the usage of `InferExcept` for overriding inferred schema properties in Pydantic models.
- Updated `noxfile.py` to set the PYTHONPATH for successful imports in notebook tests.
- Added `nbmake` and `rich` as development dependencies in `pyproject.toml`.
- Updated `pytest.ini` to include coverage for examples and enable notebook testing with `--nbmake`.
- Updated deps

107 of 121 branches covered (88.43%)

Branch coverage included in aggregate %.

10 of 13 new or added lines in 4 files covered. (76.92%)

3459 of 3987 relevant lines covered (86.76%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.14
/examples/django_setup.py
1
"""This sets up the Django environment for testing purposes.
2

3
It configures the Django settings module and initializes Django.
4
This is useful for running tests or scripts that require Django's ORM and other features.
5
"""
6

7
import os
1✔
8

9
import django
1✔
10
from django.conf import settings
1✔
11

12

13
def setup_django_environment() -> None:
1✔
14
    """Set up the Django environment for testing."""
15
    # Only setup Django if it hasn't been configured yet
NEW
16
    if not settings.configured:
×
17
        # Set the default settings module for Django
NEW
18
        _: str = os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
×
19
        # Setup Django
NEW
20
        django.setup()
×
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

© 2026 Coveralls, Inc