Update default API version to v2, fix v1 tests - #450
Merged
Conversation
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.
Purpose
This PR updates the default API version to
v2and fixes tests for thegenerateaddressendpoint inv1.Approach
The
DEFAULT_VERSIONinsettings.pywas changed fromv1tov2. Additionally, theGenerateAddressViewTestCaseintests_views_v1.pywas modified to explicitly call thev1endpoint by prefixing the URL with/v1/. A strayV1_VERSIONconstant was also added, although it's not directly used in the diff provided. Finally, the mock fornew_geonamesintests_views_v2.pywas updated tonew_geonames_v2to align with thev2context.Key Modifications
DEFAULT_VERSIONfromv1tov2inrorapi/settings.py.GenerateAddressViewTestCaseinrorapi/tests/tests_unit/tests_views_v1.pyto use/v1/generateaddress/for tests.rorapi/tests/tests_unit/tests_views_v2.pyfromupdate_address.new_geonamestoupdate_address.new_geonames_v2.Important Technical Details
v2API.generateaddressendpoint inv1tests now correctly targets thev1path, ensuring future-proof testing as the API evolves.Types of changes