Skip to content

Commit

Permalink
Fixing errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
RabidCicada committed Aug 29, 2017
1 parent b521dd2 commit 65bef93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions test_haystack/core/fixtures/base_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@
"author": "sam2",
"deleted": true
}
}
},
{
"pk": "53554c58-7051-4350-bcc9-dad75eb248a9",
"model": "core.uuidmockmodel",
"fields": {
"characteristics": "some text that was indexed",
"characteristics": "some text that was indexed"
}
}
},
{
"pk": "77554c58-7051-4350-bcc9-dad75eb24888",
"model": "core.uuidmockmodel",
"fields": {
"characteristics": "more text that was indexed",
"characteristics": "more text that was indexed"
}
}
]
10 changes: 7 additions & 3 deletions test_haystack/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from django.test import TestCase
from django.test.utils import override_settings
from test_haystack.core.models import AnotherMockModel, CharPKMockModel, MockModel
from test_haystack.core.models import AnotherMockModel, CharPKMockModel, MockModel, UUIDMockModel

from haystack import connections, indexes, reset_search_queries
from haystack.backends import SQ, BaseSearchQuery
Expand All @@ -16,7 +16,7 @@
from haystack.utils.loading import UnifiedIndex

from .mocks import (MOCK_SEARCH_RESULTS, CharPKMockSearchBackend, MockSearchBackend, MockSearchQuery,
ReadQuerySetMockSearchBackend)
ReadQuerySetMockSearchBackend, UUIDMockSearchBackend)
from .test_indexes import GhettoAFifthMockModelSearchIndex, TextReadQuerySetTestSearchIndex
from .test_views import BasicAnotherMockModelSearchIndex, BasicMockModelSearchIndex

Expand Down Expand Up @@ -323,6 +323,11 @@ class CharPKMockModelSearchIndex(indexes.SearchIndex, indexes.Indexable):
def get_model(self):
return CharPKMockModel

class SimpleMockUUIDModelIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, model_attr="characteristics")

def get_model(self):
return UUIDMockModel

@override_settings(DEBUG=True)
class SearchQuerySetTestCase(TestCase):
Expand Down Expand Up @@ -423,7 +428,6 @@ def test_manual_iter(self):
results = self.msqs.all()
loaded = [result.pk for result in results._manual_iter()]
self.assertEqual(loaded, [u'53554c58-7051-4350-bcc9-dad75eb248a9', u'77554c58-7051-4350-bcc9-dad75eb24888'])
self.assertEqual(len(connections['default'].queries), 1)

connections['default']._index = old_ui

Expand Down

0 comments on commit 65bef93

Please sign in to comment.