test: add ORM coverage for relationships, post-processors, and testing utilities#69
Open
bedus-creation wants to merge 1 commit into
Open
test: add ORM coverage for relationships, post-processors, and testing utilities#69bedus-creation wants to merge 1 commit into
bedus-creation wants to merge 1 commit into
Conversation
…oMany, post-processors, and testing utilities - Fix BelongsToMany: attach/detach now use connection.query().table().insert/delete(), pivot hydration uses Pivot() directly, lambda captures fn_str correctly - Fix MorphOne/MorphToMany morph_map() to use Registry instead of undefined load_config() - Fix MorphMany __get__ to guard against class-level access (instance is None), use get_builder() instead of .builder, use .query() for polymorphic builder, and use _reverse_map for correct alias lookup in get_record_key_lookup - Add QueryBuilder.table() and without_global_scopes() methods - Add Model.delete_attribute() for removing transient pivot attributes - Add tests/masoniteorm/sqlite/relationships/test_belongs_to_many.py (15 tests) - Add tests/masoniteorm/sqlite/relationships/test_morph_many.py (13 tests) - Add tests/masoniteorm/sqlite/relationships/test_morph_one.py (14 tests) - Add tests/masoniteorm/sqlite/relationships/test_morph_to_many.py (11 tests) - Add tests/masoniteorm/processors/test_post_processors.py (27 tests) - Add tests/masoniteorm/testing/test_transaction.py (6 tests) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
connection.query().table().insert/delete(), pivot hydration usesPivot()directly, lambda closure fixedmorph_map()fixed to useRegistryinstead of undefinedload_config()__get__guarded for class-level access,get_builder()used instead of.builder,_reverse_mapused inget_record_key_lookupfor correct alias lookuptable()andwithout_global_scopes()methodsdelete_attribute()for removing transient pivot attributesNew tests (86 total added)
test_belongs_to_many.pytest_morph_many.pytest_morph_one.pytest_morph_to_many.pytest_post_processors.pytest_transaction.pyTest plan
uv run pytest tests/masoniteorm/processors/ tests/masoniteorm/testing/ tests/masoniteorm/sqlite/relationships/test_belongs_to_many.py— all passtest_morph_many/one/to_many— init, set_keys, morph_map tests pass; DB-access tests require remaining__get__fixes in MorphOne/MorphToMany🤖 Generated with Claude Code