Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix stupid mistakes

* I had a bad import, so the Django tests were getting skipped--fixed
  that.
* Fixing that unearthed failing tests--fixed those.
  • Loading branch information...
commit ccff9b21fa2c4589bd906cd3538dbe9f0c4438bd 1 parent 1578b37
@willkg willkg authored
Showing with 7 additions and 7 deletions.
  1. +3 −3 elasticutils/__init__.py
  2. +4 −4 elasticutils/tests/test_django.py
View
6 elasticutils/__init__.py
@@ -666,7 +666,7 @@ def get_indexes(self, default_indexes=DEFAULT_INDEXES):
"""Returns the list of indexes to act on."""
for action, value in reversed(self.steps):
if action == 'indexes':
- return value
+ return list(value)
if self.type is not None:
indexes = self.type.get_index()
@@ -680,10 +680,10 @@ def get_doctypes(self, default_doctypes=DEFAULT_DOCTYPES):
"""Returns the list of doctypes to use."""
for action, value in reversed(self.steps):
if action == 'doctypes':
- return value
+ return list(value)
if self.type is not None:
- return self.type.get_mapping_type_name()
+ return [self.type.get_mapping_type_name()]
return default_doctypes
View
8 elasticutils/tests/test_django.py
@@ -25,7 +25,7 @@
from elasticutils.contrib.django import (
S, F, get_es, InvalidFieldActionError)
from elasticutils.tests.django_utils import (
- FakeDjangoMappingType, FakeDjangoMappingTypeWithIndexes, FakeModel)
+ FakeDjangoMappingType, FakeModel)
except ImportError:
SKIP_TESTS = True
@@ -39,7 +39,7 @@ def _requires_django(*args, **kwargs):
return _requires_django
-class STest(TestCase):
+class TestS(TestCase):
@requires_django
def test_require_mapping_type(self):
"""The Django S requires a mapping type."""
@@ -71,7 +71,7 @@ def test_get_indexes(self):
eq_(s.get_indexes(), ['footest', 'footest2'])
s = S(FakeDjangoMappingType).indexes('footest').indexes('footest2')
- eq_(s.get_indexes(), ['footest', 'footest2'])
+ eq_(s.get_indexes(), ['footest2'])
@requires_django
def test_get_doctypes(self):
@@ -88,7 +88,7 @@ def test_get_doctypes(self):
eq_(s.get_doctypes(), ['footype', 'footype2'])
s = S(FakeDjangoMappingType).doctypes('footype').doctypes('footype2')
- eq_(s.get_doctypes(), ['footype', 'footype2'])
+ eq_(s.get_doctypes(), ['footype2'])
class ESTest(TestCase):
Please sign in to comment.
Something went wrong with that request. Please try again.