mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
fixed userpreference test and added user info to recipe endpoint
This commit is contained in:
@@ -999,6 +999,7 @@ class RecipeSerializer(RecipeBaseSerializer):
|
||||
rating = CustomDecimalField(required=False, allow_null=True, read_only=True)
|
||||
last_cooked = serializers.DateTimeField(required=False, allow_null=True, read_only=True)
|
||||
food_properties = serializers.SerializerMethodField('get_food_properties')
|
||||
created_by = UserSerializer(read_only=True)
|
||||
|
||||
@extend_schema_field(serializers.JSONField)
|
||||
def get_food_properties(self, obj):
|
||||
|
||||
@@ -31,7 +31,7 @@ def test_preference_list(u1_s1, u2_s1, u1_s2):
|
||||
assert r.status_code == 200
|
||||
response = json.loads(r.content)
|
||||
assert len(response) == 1
|
||||
assert response[0]['user'] == auth.get_user(u1_s1).id
|
||||
assert response[0]['user']['id'] == auth.get_user(u1_s1).id
|
||||
|
||||
|
||||
@pytest.mark.parametrize("arg", [
|
||||
|
||||
Reference in New Issue
Block a user