Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Sublet Amenity Return Formatting #251

Merged
merged 16 commits into from
Mar 6, 2024
Merged

Change Sublet Amenity Return Formatting #251

merged 16 commits into from
Mar 6, 2024

Conversation

dr-Jess
Copy link
Contributor

@dr-Jess dr-Jess commented Mar 5, 2024

Previously, amenities were returned on Sublets as follows:

"amenities":[
    {
    "name":"amenityname"
    },
    {
    "name":"amenityname2"
    }
]

This pull request is to modify to a new formatting as follows:

"amenities":["amenityname","amenityname2"]

Additionally, this pull request migrates the "baths" field on sublets to allow more one-decimal place numbers.

@dr-Jess dr-Jess requested a review from judtinzhang March 5, 2024 21:05
Copy link
Member

@judtinzhang judtinzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good! One comment about tests and also current tests are failing (looks like its from decimal change). Suggest running tests locally once before pushing in the future

@@ -122,7 +122,9 @@ def destroy(self, instance):


class SubletSerializerRead(serializers.ModelSerializer):
amenities = AmenitySerializer(many=True, required=False)
amenities = serializers.PrimaryKeyRelatedField(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can we confirm this change by adding an additional check in one of our test cases? Should just be one additional assert or something to assert that the type now returned is a list of strings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! 19a351c checks this by a direct comparison to the expected string list output.

Copy link

codecov bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.37%. Comparing base (78dbf2f) to head (19a351c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #251   +/-   ##
=======================================
  Coverage   91.37%   91.37%           
=======================================
  Files          59       59           
  Lines        2515     2515           
=======================================
  Hits         2298     2298           
  Misses        217      217           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dr-Jess dr-Jess requested a review from judtinzhang March 6, 2024 00:41
@dr-Jess dr-Jess merged commit 7e43efe into master Mar 6, 2024
9 checks passed
@dr-Jess dr-Jess deleted the sublet-images branch March 6, 2024 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants