Skip to content

Commit

Permalink
removing un-needed fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanNoelk committed Apr 7, 2018
1 parent 8ea51e5 commit aa813c5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 193 deletions.
4 changes: 2 additions & 2 deletions v1/common/tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class GetSearchResultsTests(TestCase):
'test/users.json',
'course_data.json',
'cuisine_data.json',
'recipe_data.json'
'ing_data.json',
'recipe_data.json',
'ing_data.json'
]

def test_get_search_results(self):
Expand Down
35 changes: 0 additions & 35 deletions v1/fixtures/test/course.json

This file was deleted.

35 changes: 0 additions & 35 deletions v1/fixtures/test/cuisine.json

This file was deleted.

110 changes: 0 additions & 110 deletions v1/fixtures/test/recipes.json

This file was deleted.

27 changes: 16 additions & 11 deletions v1/recipe_groups/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@


class RecipeGroupsTests(TestCase):
fixtures = ['test/users.json', 'test/cuisine.json', 'test/course.json', 'test/recipes.json']
fixtures = [
'test/users.json',
'course_data.json',
'cuisine_data.json',
'recipe_data.json'
]

def setUp(self):
self.factory = APIRequestFactory()
Expand All @@ -18,10 +23,10 @@ def test_cuisine_all(self):
request = self.factory.get('/api/v1/recipe_groups/cuisine-count/')
response = view(request)

self.assertEqual(response.data.get('count'), 3)
self.assertEqual(response.data.get('count'), 1)

results = response.data.get('results')
totals = {"cuisine-1": 3, "cuisine-2": 2, "cuisine-3": 1}
totals = {"american": 31}

for item in results:
self.assertEquals(totals[item.get('slug')], item.get('total'))
Expand All @@ -31,30 +36,30 @@ def test_course_all(self):
request = self.factory.get('/api/v1/recipe_groups/course-count/')
response = view(request)

self.assertEqual(response.data.get('count'), 3)
self.assertEqual(response.data.get('count'), 1)

results = response.data.get('results')
totals = {"course-1": 3, "course-2": 2, "course-3": 1}
totals = {"entry": 31}

for item in results:
self.assertEquals(totals[item.get('slug')], item.get('total'))

def test_cuisine_with_filters(self):
view = views.CuisineCountViewSet.as_view({'get': 'list'})
request = self.factory.get('/api/v1/recipe_groups/cuisine-count/?course=course-1&rating=0')
request = self.factory.get('/api/v1/recipe_groups/cuisine-count/?course=entry&rating=3')
response = view(request)

self.assertEqual(response.data.get('count'), 1)

results = response.data.get('results')
totals = {"cuisine-1": 1}
totals = {"american": 31}

for item in results:
self.assertEquals(totals[item.get('slug')], item.get('total'))

def test_cuisine_with_course_filter_no_results(self):
view = views.CuisineCountViewSet.as_view({'get': 'list'})
request = self.factory.get('/api/v1/recipe_groups/cuisine-count/?course=course-4&rating=0')
request = self.factory.get('/api/v1/recipe_groups/cuisine-count/?course=entry&rating=0')
response = view(request)

self.assertEqual(response.data.get('count'), 0)
Expand All @@ -68,20 +73,20 @@ def test_cuisine_with_non_existent_course(self):

def test_course_with_filters(self):
view = views.CourseCountViewSet.as_view({'get': 'list'})
request = self.factory.get('/api/v1/recipe_groups/course-count/?cuisine=cuisine-1&rating=1')
request = self.factory.get('/api/v1/recipe_groups/course-count/?cuisine=american&rating=3')
response = view(request)

self.assertEqual(response.data.get('count'), 1)

results = response.data.get('results')
totals = {"course-3": 1}
totals = {"entry": 31}

for item in results:
self.assertEquals(totals[item.get('slug')], item.get('total'))

def test_course_with_cuisine_filter_no_results(self):
view = views.CourseCountViewSet.as_view({'get': 'list'})
request = self.factory.get('/api/v1/recipe_groups/course-count/?cuisine=cuisine-4&rating=0')
request = self.factory.get('/api/v1/recipe_groups/course-count/?cuisine=american&rating=0')
response = view(request)

self.assertEqual(response.data.get('count'), 0)
Expand Down

0 comments on commit aa813c5

Please sign in to comment.