-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
72 deletions.
There are no files selected for viewing
This file contains 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
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# TODO: this test was moved from the recipe to the rating app | ||
# #!/usr/bin/env python | ||
# # encoding: utf-8 | ||
# | ||
# import mock | ||
# from django.test import TestCase | ||
# from copy import deepcopy | ||
# | ||
# from v1.recipe.serializers import RecipeSerializer | ||
# from v1.recipe.models import Recipe | ||
# | ||
# | ||
# class RecipeSerializerTests(TestCase): | ||
# def setUp(self): | ||
# self.serializer = RecipeSerializer() | ||
# self.data = { | ||
# "id": 1, | ||
# "ingredients": [], | ||
# "directions": '', | ||
# "tags": [], | ||
# "title": "Recipe name", | ||
# "info": "Recipe info", | ||
# "source": "", | ||
# "prep_time": 60, | ||
# "cook_time": 60, | ||
# "servings": 8, | ||
# "rating": 0, | ||
# "author": 1, | ||
# "cuisine": 1, | ||
# "course": 2 | ||
# } | ||
# | ||
# def test_rating_over_success(self): | ||
# data = deepcopy(self.data) | ||
# | ||
# data['rating'] = 20 | ||
# | ||
# recipe = mock.Mock(spec=Recipe) | ||
# response = self.serializer.update(recipe, data) | ||
# | ||
# self.assertEqual(response.rating, 5) | ||
# | ||
# def test_rating_under_success(self): | ||
# data = deepcopy(self.data) | ||
# | ||
# data['rating'] = -20 | ||
# | ||
# recipe = mock.Mock(spec=Recipe) | ||
# response = self.serializer.update(recipe, data) | ||
# | ||
# self.assertEqual(response.rating, 0) | ||
# | ||
# def test_no_rating_supplied_success(self): | ||
# data = deepcopy(self.data) | ||
# | ||
# del data['rating'] | ||
# | ||
# recipe = mock.Mock(spec=Recipe) | ||
# recipe.rating = 3 | ||
# response = self.serializer.update(recipe, data) | ||
# | ||
# self.assertEqual(response.rating, 3) | ||
# |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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