Skip to content

Commit

Permalink
Update: fix PEP-8 formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
PC-Ngumoha committed Mar 15, 2024
1 parent deea582 commit bfb784c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/recipe/tests/test_recipe_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def test_update_recipe_assign_ingredient(self):
"""Tests assigning an existing ingredient when updating a recipe.
"""
ingredient1 = Ingredient.objects.create(user=self.user,
name='Pepper')
name='Pepper')
recipe = create_recipe(user=self.user)
recipe.ingredients.add(ingredient1)

Expand All @@ -366,7 +366,6 @@ def test_update_recipe_assign_ingredient(self):
self.assertIn(ingredient2, recipe.ingredients.all())
self.assertNotIn(ingredient1, recipe.ingredients.all())


def test_clear_recipe_ingredients(self):
"""Tests clearing a recipe's ingredients"""
ingredient = Ingredient.objects.create(user=self.user,
Expand Down
2 changes: 2 additions & 0 deletions app/recipe/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def perform_create(self, serializer):
"""Create a new recipe"""
serializer.save(user=self.request.user)


class BaseRecipeAttrViewSet(mixins.ListModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
Expand All @@ -43,6 +44,7 @@ def get_queryset(self):
"""Filter queryset to authenticated user"""
return self.queryset.filter(user=self.request.user).order_by('-name')


class TagViewSet(BaseRecipeAttrViewSet):
"""Manage tags in the database."""
serializer_class = serializers.TagSerializer
Expand Down

0 comments on commit bfb784c

Please sign in to comment.