You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(dates): Rename date filters for clarity and improve tests
This commit introduces a significant refactoring of the date filtering components to improve clarity, fix bugs, and enhance the test suite.
Key Changes:
- **Filter Renaming:**
- `DateRangeFilter` has been renamed to `DateFilter` to better reflect its general-purpose nature for filtering dates.
- `DateInDateRange` has been renamed to `DateInDateRangeFilter` for consistency with other filter classes.
- Documentation (`README.md`, `docs/`) and module exports have been updated accordingly.
- **Bug Fix:**
- Fixed a bug in `DateInDateRangeFilter` where `strptime` was using an incorrect format string that included a time component. It now correctly uses `"%Y-%m-%d"`.
- **Test Enhancements:**
- Added a `DateRangeField` named `validity` to the `DemoModelField` test model to allow for realistic testing of the `DateInDateRangeFilter`.
- Updated `DemoModelFieldFactory` to generate `DateRange` objects for the new field.
- Added a comprehensive set of tests for `DateInDateRangeFilter`, covering both standard and negated queries.
- Updated existing tests to use the new filter names.
- **Database Migration:**
- Added a new migration for the `depot` application (`0004_alter_storedfilter_query_string.py`) to change the `query_string` field on the `StoredFilter` model to a `TextField` with a default value.
- **Development Dependencies:**
- Added `pdbpp` to the development dependencies to provide an enhanced debugger.
0 commit comments