Repository navigation
Release 0.9 - #31
Open
domdinicola wants to merge 37 commits into
Open
Release 0.9#31domdinicola wants to merge 37 commits into
domdinicola wants to merge 37 commits into
Conversation
* Alter "all_fields" methods of "FieldsetAdmin" Check if name is being duplicated for the fields within a given fieldset, raise exception if it is the case * Add tests for validation changes of field names --------- Co-authored-by: patsatsia <giorgi.patsatsia@valor-software.com>
…ess in DataChecker - Introduced IdentityField to mark a record's identity, ensuring only one instance per DataChecker. - Updated DataCheckerFieldsetFormset to validate the uniqueness of IdentityField across datasets. - Registered IdentityField in FieldRegistry for proper integration. - Adjusted ValidatorMixin to recognize IdentityField as the primary key field.
…p/pytest via venv python. (#26)
- Created a new migration to add IdentityField, ensuring safe and idempotent execution with create_default_fields. - Updated ValidatorMixin to auto-detect IdentityField as primary key only if not explicitly set. - Adjusted test to reflect the increase in processed objects due to the new IdentityField addition.
…ment - Implemented tests for ValidatableFileValidator to ensure it correctly accepts and rejects file formats based on extensions. - Added tests to validate the enforcement of a single IdentityField across multiple fieldsets in DataChecker. - Enhanced existing tests in test_base.py to verify IdentityField behavior, including auto-detection as primary key and handling of duplicates.
- Added blank lines for better readability and separation of test sections in test_admin_checker.py. - Ensured consistent formatting across test functions for improved clarity.
- Introduced a fixture to create a DataChecker with two IdentityField members for testing. - Added a test to verify that a formset row marked for deletion is correctly skipped during validation, preventing errors related to multiple IdentityFields. - Ensured that the test checks for the absence of the 'Only one IdentityField is allowed' error when a member is deleted.
#25) * 298132: Add IdentityField for collision detection and enforce uniqueness in DataChecker - Introduced IdentityField to mark a record's identity, ensuring only one instance per DataChecker. - Updated DataCheckerFieldsetFormset to validate the uniqueness of IdentityField across datasets. - Registered IdentityField in FieldRegistry for proper integration. - Adjusted ValidatorMixin to recognize IdentityField as the primary key field. * Add migration to introduce IdentityField in FieldDefinition catalogue - Created a new migration to add IdentityField, ensuring safe and idempotent execution with create_default_fields. - Updated ValidatorMixin to auto-detect IdentityField as primary key only if not explicitly set. - Adjusted test to reflect the increase in processed objects due to the new IdentityField addition. * Add unit tests for ValidatableFileValidator and IdentityField enforcement - Implemented tests for ValidatableFileValidator to ensure it correctly accepts and rejects file formats based on extensions. - Added tests to validate the enforcement of a single IdentityField across multiple fieldsets in DataChecker. - Enhanced existing tests in test_base.py to verify IdentityField behavior, including auto-detection as primary key and handling of duplicates. * Refactor test_admin_checker.py to improve test organization - Added blank lines for better readability and separation of test sections in test_admin_checker.py. - Ensured consistent formatting across test functions for improved clarity. * Add test for DataCheckerFieldsetFormset to handle deleted inline members - Introduced a fixture to create a DataChecker with two IdentityField members for testing. - Added a test to verify that a formset row marked for deletion is correctly skipped during validation, preventing errors related to multiple IdentityFields. - Ensured that the test checks for the absence of the 'Only one IdentityField is allowed' error when a member is deleted. --------- Co-authored-by: ArsenPidhoretskyi <arsen.pidhoretskyi@valor.com> Co-authored-by: Domenico <ddinicola@unicef.org>
* fix CI venv cache: key by resolved Python patch, upgrade venv, run pip/pytest via venv python. * add fieldset cross-field JavaSript validation with error handling * move fieldset validation to the FieldSet class * merged fieldset_rules_validation implementation into the Fieldset model --------- Co-authored-by: Domenico <ddinicola@unicef.org>
- Updated IdentityField to be read-only, preventing changes through normal form editing. - Modified validation to ensure uniqueness of values during import, reinforcing data integrity.
…logue, as it is no longer needed.
…-support 298132: Colission detection support adjustments
- Introduced `is_file` property in `FlexField` to identify binary/file data fields. - Added `get_file_field_names` method in `DataChecker` to retrieve names of fields that hold file data. - Implemented `split_data` method in `DataChecker` to separate text fields from file fields in a given data mapping. - Enhanced tests to verify the new functionality for file and text field handling.
- Moved the import of `forms` in `flexfield.py` to the top for better readability. - Removed redundant import of `field_registry` in the test model file to streamline the code.
- Introduced a new test to verify that the `is_file` property of `FlexField` returns False when the field cannot be built due to a `FlexFieldCreationError`. - Utilized mocking to simulate the error condition in the test case.
- Consolidated import statements by moving `patch` and `FlexFieldCreationError` to the top of the file for improved clarity. - Removed duplicate imports from the `test_flexfield_is_file_false_when_field_cannot_be_built` test function to streamline the code.
- Updated the `is_file` property in `FlexField` to directly check the field type using `issubclass`, enhancing its reliability by removing the dependency on the `get_field` method. - Removed the test case that handled `FlexFieldCreationError`, as the new implementation no longer requires it.
…-out-of-flex 320213: Add file handling capabilities to DataChecker and FlexField
#30) * Enhance DataChecker's split_data method to accept optional file field names - Updated the `split_data` method to allow passing a collection of file field names, improving flexibility in data separation. - Added a memoized method `get_file_field_names` to optimize retrieval of file field names. - Introduced a new test to verify that `split_data` correctly uses provided file field names without calling `get_file_field_names`. * Update pyproject.toml to correctly define dynamic versioning - Removed the incorrect dynamic version declaration from the project section. - Added the dynamic version declaration back to the appropriate location in the file. * Refactor test for DataChecker's split_data method to use context manager for mocking - Updated the test for `split_data` to utilize `unittest.mock.patch` as a context manager, improving readability and ensuring proper cleanup of the mock. - Removed the dependency on the `mocker` fixture for this test, streamlining the test setup. --------- Co-authored-by: ArsenPidhoretskyi <arsen.pidhoretskyi@valor.com>
* Extract the file-field abstraction into the library Promotes the generic parts of the flex-file offload from Country Workspace so that consumers share one field type and one reference format instead of each redefining them. * Use fixed field type and attrs in migration 0018 and make Pillow a regular dependency
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update CHANGES file for 0.9 release with all changes from 0.8.x tags