forked from liberation/django-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Simplify the whole module to make it work with 1.8 - Pass all tests but restframework contrib's for django 1.8 - Fix a false positive on the es query fallback
- Loading branch information
Showing
14 changed files
with
78 additions
and
100 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
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
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 |
---|---|---|
@@ -1,44 +1,6 @@ | ||
from unittest import TestSuite | ||
from unittest import TestLoader | ||
from unittest import TestCase | ||
|
||
from django_elasticsearch.tests.models import TestModel | ||
from django_elasticsearch.tests.test_views import EsViewTestCase | ||
from django_elasticsearch.tests.test_qs import EsQuerysetTestCase | ||
from django_elasticsearch.tests.test_indexable import EsIndexableTestCase | ||
|
||
__all__ = ['EsQuerysetTestCase', 'EsViewTestCase', 'EsIndexableTestCase', 'EsRestFrameworkTestCase'] | ||
|
||
try: | ||
from django_elasticsearch.tests.test_restframework import EsRestFrameworkTestCase | ||
except Exception, e: | ||
print 'Skipping test of restframework contrib, reason: ', e | ||
|
||
class FakeTestCase(TestCase): | ||
""" | ||
Note: have to do this, because if i append the TestCase to the suit | ||
dynamically i can't call it with test django_elasticsearch.MyTest | ||
""" | ||
pass | ||
EsRestFrameworkTestCase = FakeTestCase | ||
else: | ||
print 'App restframework found, testing contrib.restframework' | ||
|
||
|
||
def suite(): | ||
suite = TestSuite() | ||
loader = TestLoader() | ||
|
||
test_cases = [ | ||
EsViewTestCase, | ||
EsQuerysetTestCase, | ||
EsIndexableTestCase, | ||
EsRestFrameworkTestCase] | ||
|
||
if not TestModel.es.check_cluster(): | ||
print "Test skipped. Could not connect to elasticsearch." | ||
else: | ||
for test_case in test_cases: | ||
tests = loader.loadTestsFromTestCase(test_case) | ||
suite.addTests(tests) | ||
|
||
return suite |
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
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
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
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
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
# | ||
# django>=1.8, <1.9 | ||
django>=1.7, <1.8 | ||
# django>=1.4, <1.5 | ||
# django>=1.6, <1.7 | ||
|
||
djangorestframework>=2.4, <3.0 # for django<1.8 | ||
# djangorestframework>=3.0, <4.0 # for django>=1.8 | ||
|
||
# dev tools | ||
mock | ||
six | ||
django-filter | ||
djangorestframework==2.4 | ||
django-extensions |
Oops, something went wrong.