Add integration tests for storage layer to catch breaking changes in social-core API #811
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.
Problem
Issue #660 highlighted that breaking changes in the social-core storage API can go unnoticed until they cause runtime failures in production. Specifically, social-core PR #986 introduced a breaking change in the OpenID storage API that raised
NotImplementedErrorwhen callingget_association():The issue occurred because:
OpenIdStore.getAssociation()callsself.assoc.oids()AssociationMixin.oids()callscls.get(**kwargs)get()wasn't properly implemented, it raisedNotImplementedErrorSolution
This PR adds comprehensive integration tests for the storage layer to prevent similar issues in the future. The new test file
tests/test_storage_integration.pyincludes:Test Coverage
1. Full OpenID Workflow Tests (
TestStorageIntegration)2. Critical API Integration Tests (
TestAssociationMixinIntegration)oids()method that was the breaking pointget()method implementation3. Nonce Storage Tests (
TestNonceMixinIntegration)Key Features
✅ End-to-end testing - Tests the complete call stack from
OpenIdStoredown to Django ORM, not just individual methods✅ Real API usage - Uses actual
social_core.store.OpenIdStoreinstead of mocks to catch integration issues✅ Time-aware - Uses proper timestamps to test association expiration logic correctly
✅ Well-documented - Includes detailed explanation of the issue and what each test validates
Test Results
These tests will catch breaking changes in social-core's storage API before they reach production, addressing the core issue raised in #176.
Fixes #660
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.