-
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.
refactoring the way tests are stored
- Loading branch information
Showing
7 changed files
with
49 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
from django.test import TestCase | ||
from v1.recipe.models import Recipe | ||
from v1.common.recipe_search import get_search_results | ||
|
||
|
||
class GetSearchResultsTests(TestCase): | ||
fixtures = [ | ||
'test/users.json', | ||
'course_data.json', | ||
'cuisine_data.json', | ||
'ing_data.json', | ||
'recipe_data.json' | ||
] | ||
|
||
def test_get_search_results(self): | ||
query = get_search_results( | ||
['title', 'ingredient_groups__ingredients__title', 'tags__title'], | ||
Recipe.objects, | ||
'chili' | ||
).distinct() | ||
|
||
self.assertTrue(len(query.all()) > 0) | ||
|
||
def test_get_search_no_results(self): | ||
query = get_search_results( | ||
['title', 'ingredient_groups__ingredients__title', 'tags__title'], | ||
Recipe.objects, | ||
'blue berry' | ||
).distinct() | ||
|
||
self.assertTrue(len(query.all()) == 0) |
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,2 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 |
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,2 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 |